Skip to content

Commit

Permalink
✨ feat: 优化设置页
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Jul 16, 2023
1 parent a3d9724 commit 47b316c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"react-layout-kit": "^1",
"swr": "^2",
"ts-md5": "^1",
"zustand": "4.3.7",
"zustand": "^4",
"zustand-utils": "^1"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions public/locales/zh_CN/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"subTitle": "值越大,越有可能扩展到新话题"
},
"sendKey": "发送键",
"setting": "设置",
"temperature": {
"title": "随机性 (temperature)",
"subTitle": "值越大,回复越随机"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/chat/[id]/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const Header = memo(() => {
<ActionIcon icon={ArchiveIcon} size={{ fontSize: 24 }} title={t('archive')} />
<ActionIcon
icon={MoreVerticalIcon}
onClick={toggleConfig}
onClick={() => toggleConfig()}
size={{ fontSize: 24 }}
title={t('sessionSetting')}
/>
Expand Down
14 changes: 3 additions & 11 deletions src/pages/setting/index.page.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
import isEqual from 'fast-deep-equal';
import { useTranslation } from 'next-i18next';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import Head from 'next/head';
import { memo } from 'react';
import { Flexbox } from 'react-layout-kit';

import { sessionSelectors, useChatStore } from '@/store/session';

import Sidebar from '../Sidebar';
import { Sessions } from '../chat/SessionList';
import Header from './Header';

const SettingLayout = memo(() => {
const [title] = useChatStore((s) => {
const context = sessionSelectors.currentSession(s);
return [context?.meta.title];
}, isEqual);

const { t } = useTranslation();
return (
<>
<Head>
<title>{title ? `${title} - LobeChat` : 'LobeChat'}</title>
<title>{t('setting')} - LobeChat</title>
</Head>
<Flexbox horizontal width={'100%'}>
<Sidebar />
<Sessions />
<Flexbox flex={1}>
<Header />
</Flexbox>
Expand Down

0 comments on commit 47b316c

Please sign in to comment.