diff --git a/src/components/layout/new-header/AvatarMenu.tsx b/src/components/layout/new-header/AvatarMenu.tsx index 250c709d9..7cf10347a 100644 --- a/src/components/layout/new-header/AvatarMenu.tsx +++ b/src/components/layout/new-header/AvatarMenu.tsx @@ -5,6 +5,7 @@ import { IconInfoCircle, IconLogin, IconLogout, + IconMoonStars, IconSun, IconUserSearch, } from '@tabler/icons-react'; @@ -13,11 +14,15 @@ import { signOut, useSession } from 'next-auth/react'; import Link from 'next/link'; import { forwardRef } from 'react'; import { AboutModal } from '~/components/Dashboard/Modals/AboutModal/AboutModal'; +import { useColorScheme } from '~/hooks/use-colorscheme'; export const AvatarMenu = () => { const newVersionAvailable = '0.13.0'; const [aboutModalOpened, aboutModal] = useDisclosure(false); const { data: sessionData } = useSession(); + const { colorScheme, toggleColorScheme } = useColorScheme(); + + const Icon = colorScheme === 'dark' ? IconSun : IconMoonStars; return ( <> @@ -27,7 +32,9 @@ export const AvatarMenu = () => { - }>Switch theme + } onClick={toggleColorScheme}> + Switch theme + {sessionData?.user && ( <> }>View Profile