-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
63 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
'use client'; | ||
|
||
import { Model } from '@/utils/constants'; | ||
|
||
/** | ||
* 聊天记录 | ||
*/ | ||
export const Settings = () => { | ||
const models = [Model['gpt-3.5-turbo-0301']]; | ||
|
||
return ( | ||
<div> | ||
<div className="m-4"> | ||
模型: | ||
<select value={models[0]}> | ||
{models.map((model) => ( | ||
<option key={model}>{model}</option> | ||
))} | ||
</select> | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { useEffect } from 'react'; | ||
|
||
export const useDarkMode = () => { | ||
useEffect(() => { | ||
const link = document.createElement('link'); | ||
link.rel = 'stylesheet'; | ||
|
||
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { | ||
// 暗色模式 | ||
link.href = '/prism-dark.css'; | ||
} else { | ||
// 浅色模式 | ||
link.href = '/prism-light.css'; | ||
} | ||
document.head.appendChild(link); | ||
|
||
let darkModeQuery = window.matchMedia('(prefers-color-scheme: dark)'); | ||
darkModeQuery.addEventListener('change', (e) => { | ||
if (e.matches) { | ||
// 暗色模式 | ||
link.href = '/prism-dark.css'; | ||
} else { | ||
// 浅色模式 | ||
link.href = '/prism-light.css'; | ||
} | ||
}); | ||
}, []); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5d47798
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
chatgpt-next – ./
chatgpt-next-xcatliu.vercel.app
chatgpt-next-git-main-xcatliu.vercel.app