mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
chore: style
This commit is contained in:
16
src/layout/index.scss
vendored
16
src/layout/index.scss
vendored
@@ -1,16 +1,23 @@
|
||||
.chat-logo {
|
||||
text-align: center;
|
||||
padding: 5px 0;
|
||||
height: 48px;
|
||||
|
||||
img {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.chat-info {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
|
||||
.ant-tag {
|
||||
margin: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-layout-sider-trigger {
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
@@ -24,9 +31,6 @@
|
||||
.ant-menu {
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
.ant-menu-item {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-layout-footer {
|
||||
|
||||
28
src/layout/index.tsx
vendored
28
src/layout/index.tsx
vendored
@@ -1,5 +1,5 @@
|
||||
import { FC, useState } from 'react';
|
||||
import {Layout, Menu, Button, Tooltip, message, ConfigProvider, theme, Tag} from 'antd';
|
||||
import { 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';
|
||||
import { getName, getVersion } from '@tauri-apps/api/app';
|
||||
@@ -13,25 +13,21 @@ const { Content, Footer, Sider } = Layout;
|
||||
const appName = await getName();
|
||||
const appVersion = await getVersion();
|
||||
const appTheme = await invoke("get_theme");
|
||||
console.log("theme:"+appTheme);
|
||||
interface ChatLayoutProps {
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
|
||||
const ChatLayout: FC<ChatLayoutProps> = ({ children }) => {
|
||||
export default function ChatLayout() {
|
||||
const [collapsed, setCollapsed] = useState(false);
|
||||
const location = useLocation();
|
||||
const go = useNavigate();
|
||||
|
||||
const checkAppUpdate = async () => {
|
||||
await invoke('run_check_update', {silent: false});
|
||||
await invoke('run_check_update', { silent: false });
|
||||
}
|
||||
|
||||
return (
|
||||
<ConfigProvider theme={{algorithm: appTheme === "dark" ? theme.darkAlgorithm : theme.defaultAlgorithm}}>
|
||||
<Layout style={{ minHeight: '100vh' }} hasSider>
|
||||
<Sider
|
||||
theme={ appTheme === "dark" ? "dark" : "light" }
|
||||
theme={appTheme === "dark" ? "dark" : "light"}
|
||||
collapsible
|
||||
collapsed={collapsed}
|
||||
onCollapse={(value) => setCollapsed(value)}
|
||||
@@ -47,19 +43,13 @@ const ChatLayout: FC<ChatLayoutProps> = ({ children }) => {
|
||||
>
|
||||
<div className="chat-logo"><img src="/logo.png" /></div>
|
||||
<div className="chat-info">
|
||||
<Tag>{appName}</Tag>
|
||||
</div>
|
||||
<div className="chat-info">
|
||||
<Tag>{appName}</Tag>
|
||||
<Tag>
|
||||
<span>{appVersion}</span>
|
||||
<span> </span>
|
||||
{
|
||||
<span style={{ marginRight: 5 }}>{appVersion}</span>
|
||||
<Tooltip title="click to check update">
|
||||
<a onClick={checkAppUpdate}><SyncOutlined /></a>
|
||||
</Tooltip>
|
||||
}
|
||||
</Tag>
|
||||
|
||||
</div>
|
||||
|
||||
<Menu
|
||||
@@ -87,6 +77,4 @@ const ChatLayout: FC<ChatLayoutProps> = ({ children }) => {
|
||||
</Layout>
|
||||
</ConfigProvider>
|
||||
);
|
||||
};
|
||||
|
||||
export default ChatLayout;
|
||||
};
|
||||
2
src/main.scss
vendored
2
src/main.scss
vendored
@@ -63,7 +63,7 @@ html, body {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: #2a2a2a;
|
||||
// color: #2a2a2a;
|
||||
}
|
||||
|
||||
span {
|
||||
|
||||
24
src/view/General.tsx
vendored
24
src/view/General.tsx
vendored
@@ -114,20 +114,23 @@ export default function General() {
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 15, offset: 1 }}
|
||||
>
|
||||
<Form.Item label="Stay On Top" name="stay_on_top" valuePropName="checked">
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
{platformInfo === 'darwin' && (
|
||||
<Form.Item label="Titlebar" name="titlebar" valuePropName="checked">
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
)}
|
||||
<Form.Item label="Theme" name="theme">
|
||||
<Radio.Group>
|
||||
<Radio value="Light">Light</Radio>
|
||||
<Radio value="Dark">Dark</Radio>
|
||||
{
|
||||
(["darwin", "windows"].includes(platformInfo) ) && (
|
||||
<Radio value="System">System</Radio>
|
||||
)
|
||||
}
|
||||
{["darwin", "windows"].includes(platformInfo) && (
|
||||
<Radio value="System">System</Radio>
|
||||
)}
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
<Form.Item label="Stay On Top" name="stay_on_top" valuePropName="checked">
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
<Form.Item label={<AutoUpdateLabel />} name="auto_update">
|
||||
<Radio.Group>
|
||||
<Radio value="Prompt">Prompt</Radio>
|
||||
@@ -138,11 +141,6 @@ export default function General() {
|
||||
<Form.Item label={<GlobalShortcut />} name="global_shortcut">
|
||||
<Input placeholder="CmdOrCtrl+Shift+O" {...DISABLE_AUTO_COMPLETE} />
|
||||
</Form.Item>
|
||||
{platformInfo === 'darwin' && (
|
||||
<Form.Item label="Titlebar" name="titlebar" valuePropName="checked">
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
)}
|
||||
<Form.Item label={<OriginLabel url={chatConf?.default_origin} />} name="origin">
|
||||
<Input placeholder="https://chat.openai.com" {...DISABLE_AUTO_COMPLETE} />
|
||||
</Form.Item>
|
||||
|
||||
Reference in New Issue
Block a user