From 710b72d0535addfc8cc3c4ed2ca642508726e8e9 Mon Sep 17 00:00:00 2001 From: WanQuanXie Date: Tue, 28 May 2024 10:48:58 +0800 Subject: [PATCH] feat(ui): theme switcher show in responsive mode --- ui/components/Navbar.tsx | 3 +++ ui/components/theme/Switcher.tsx | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ui/components/Navbar.tsx b/ui/components/Navbar.tsx index 91e131f..4159161 100644 --- a/ui/components/Navbar.tsx +++ b/ui/components/Navbar.tsx @@ -2,6 +2,7 @@ import { Clock, Edit, Share, Trash } from 'lucide-react'; import { Message } from './ChatWindow'; import { useEffect, useState } from 'react'; import { formatTimeDifference } from '@/lib/utils'; +import { ThemeSwitcher } from './theme/Switcher'; const Navbar = ({ messages }: { messages: Message[] }) => { const [title, setTitle] = useState(''); @@ -49,6 +50,8 @@ const Navbar = ({ messages }: { messages: Message[] }) => {

{title}

+ + handleThemeSwitch('light')} /> ) : isTheme('light') ? ( handleThemeSwitch('dark')} /> ) : ( handleThemeSwitch('system')} /> );