diff --git a/src/renderer/src/components/app/Sidebar.tsx b/src/renderer/src/components/app/Sidebar.tsx index 53c9b548..c15b5437 100644 --- a/src/renderer/src/components/app/Sidebar.tsx +++ b/src/renderer/src/components/app/Sidebar.tsx @@ -1,6 +1,7 @@ import { FileSearchOutlined, FolderOutlined, PictureOutlined, TranslationOutlined } from '@ant-design/icons' import { isMac } from '@renderer/config/constant' import { isLocalAi, UserAvatar } from '@renderer/config/env' +import { useTheme } from '@renderer/context/ThemeProvider' import useAvatar from '@renderer/hooks/useAvatar' import { useRuntime } from '@renderer/hooks/useRuntime' import { useSettings } from '@renderer/hooks/useSettings' @@ -21,6 +22,7 @@ const Sidebar: FC = () => { const { t } = useTranslation() const navigate = useNavigate() const { windowStyle } = useSettings() + const { theme, toggleTheme } = useTheme() const isRoute = (path: string): string => (pathname === path ? 'active' : '') const isRoutes = (path: string): string => (pathname.startsWith(path) ? 'active' : '') @@ -86,6 +88,14 @@ const Sidebar: FC = () => { + toggleTheme()}> + {theme === 'dark' ? ( + + ) : ( + + )} + + to(isLocalAi ? '/settings/assistant' : '/settings/provider')}> diff --git a/src/renderer/src/pages/home/Navbar.tsx b/src/renderer/src/pages/home/Navbar.tsx index 3a6ff055..9cb6dd8f 100644 --- a/src/renderer/src/pages/home/Navbar.tsx +++ b/src/renderer/src/pages/home/Navbar.tsx @@ -63,12 +63,6 @@ const HeaderNavbar: FC = ({ activeAssistant }) => { - } - unCheckedChildren={} - checked={theme === 'dark'} - onChange={toggleTheme} - /> {topicPosition === 'right' && (