mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
chore: settings
This commit is contained in:
4
src/layout/index.scss
vendored
4
src/layout/index.scss
vendored
@@ -23,6 +23,10 @@
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
|
||||
.ant-layout-sider-children {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.chat-container {
|
||||
padding: 20px;
|
||||
overflow: hidden;
|
||||
|
||||
9
src/layout/index.tsx
vendored
9
src/layout/index.tsx
vendored
@@ -1,4 +1,4 @@
|
||||
import { useState } from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Layout, Menu, Tooltip, ConfigProvider, theme, Tag } from 'antd';
|
||||
import { SyncOutlined } from '@ant-design/icons';
|
||||
import { useNavigate, useLocation } from 'react-router-dom';
|
||||
@@ -15,8 +15,13 @@ export default function ChatLayout() {
|
||||
const [collapsed, setCollapsed] = useState(false);
|
||||
const [appInfo, setAppInfo] = useState<Record<string, any>>({});
|
||||
const location = useLocation();
|
||||
const [menuKey, setMenuKey] = useState(location.pathname);
|
||||
const go = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
setMenuKey(location.pathname);
|
||||
}, [location.pathname]);
|
||||
|
||||
useInit(async () => {
|
||||
setAppInfo({
|
||||
appName: await getName(),
|
||||
@@ -65,7 +70,7 @@ export default function ChatLayout() {
|
||||
</div>
|
||||
|
||||
<Menu
|
||||
defaultSelectedKeys={[location.pathname]}
|
||||
selectedKeys={[menuKey]}
|
||||
mode="inline"
|
||||
theme={appInfo.appTheme === 'dark' ? 'dark' : 'light'}
|
||||
inlineIndent={12}
|
||||
|
||||
Reference in New Issue
Block a user