diff --git a/app/404.tsx b/app/404.tsx deleted file mode 100644 index 0cd25afd..00000000 --- a/app/404.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import Link from "next/link"; - -export default function FourOhFour() { - return ( - <> -

404 - Page Not Found

- - Go back home - - - ); -} diff --git a/app/500.tsx b/app/500.tsx deleted file mode 100644 index c518c57b..00000000 --- a/app/500.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import Link from "next/link"; - -export default function FourOhFour() { - return ( - <> -

500 - Page Not Found

- - Go back home - - - ); -} diff --git a/app/components/home.module.scss b/app/components/home.module.scss index 0c3c07da..73464a5a 100644 --- a/app/components/home.module.scss +++ b/app/components/home.module.scss @@ -1,18 +1,33 @@ -.container { - max-width: 1080px; - min-width: 600px; - min-height: 480px; - width: 90vw; - height: 90vh; +@mixin container { background-color: var(--white); border: var(--border-in-light); border-radius: 20px; box-shadow: var(--shadow); color: var(--black); background-color: var(--white); + min-width: 600px; + min-height: 480px; display: flex; overflow: hidden; + box-sizing: border-box; +} + +.container { + @include container(); + + max-width: 1080px; + max-height: 864px; + width: 90vw; + height: 90vh; +} + +.tight-container { + @include container(); + + width: 100vw; + height: 100vh; + border-radius: 0; } .sidebar { diff --git a/app/components/home.tsx b/app/components/home.tsx index 4916dca0..b92aeb8a 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -291,11 +291,16 @@ export function Home() { // settings const [openSettings, setOpenSettings] = useState(false); + const config = useChatStore((state) => state.config); useSwitchTheme(); return ( -
+
ChatGPT Next
@@ -347,9 +352,10 @@ export function Home() { export function Settings() { const [showEmojiPicker, setShowEmojiPicker] = useState(false); - const [config, updateConfig] = useChatStore((state) => [ + const [config, updateConfig, resetConfig] = useChatStore((state) => [ state.config, state.updateConfig, + state.resetConfig, ]); return ( @@ -361,7 +367,12 @@ export function Settings() {
- } bordered title="重置所有选项" /> + } + onClick={resetConfig} + bordered + title="重置所有选项" + />
@@ -432,6 +443,19 @@ export function Settings() {
+ + +
紧凑边框
+ + updateConfig( + (config) => (config.tightBorder = e.currentTarget.checked) + ) + } + > +
diff --git a/app/store.ts b/app/store.ts index 27a97cd1..a9e50e42 100644 --- a/app/store.ts +++ b/app/store.ts @@ -30,8 +30,18 @@ interface ChatConfig { submitKey: SubmitKey; avatar: string; theme: Theme; + tightBorder: boolean; } +const DEFAULT_CONFIG: ChatConfig = { + historyMessageCount: 5, + sendBotMessages: false as boolean, + submitKey: SubmitKey.CtrlEnter as SubmitKey, + avatar: "1fae0", + theme: Theme.Auto as Theme, + tightBorder: false, +}; + interface ChatStat { tokenCount: number; wordCount: number; @@ -94,6 +104,7 @@ interface ChatStore { ) => void; getConfig: () => ChatConfig; + resetConfig: () => void; updateConfig: (updater: (config: ChatConfig) => void) => void; } @@ -103,11 +114,11 @@ export const useChatStore = create()( sessions: [createEmptySession()], currentSessionIndex: 0, config: { - historyMessageCount: 5, - sendBotMessages: false as boolean, - submitKey: SubmitKey.CtrlEnter as SubmitKey, - avatar: "1fae0", - theme: Theme.Auto as Theme, + ...DEFAULT_CONFIG, + }, + + resetConfig() { + set(() => ({ config: { ...DEFAULT_CONFIG } })); }, getConfig() { diff --git a/next.config.js b/next.config.js index 6c1a5eee..ad56ba5b 100644 --- a/next.config.js +++ b/next.config.js @@ -1,8 +1,6 @@ /** @type {import('next').NextConfig} */ -const withLess = require("next-with-less"); - -const nextConfig = withLess({ +const nextConfig = { experimental: { appDir: true, }, @@ -14,6 +12,6 @@ const nextConfig = withLess({ return config; }, -}); +}; module.exports = nextConfig;