diff --git a/src/components/theme-toggle.tsx b/src/components/theme-toggle.tsx index 0adfb3a7b43265..8fdcea8f191e5d 100644 --- a/src/components/theme-toggle.tsx +++ b/src/components/theme-toggle.tsx @@ -1,5 +1,6 @@ 'use client'; import {MoonIcon, SunIcon} from '@radix-ui/react-icons'; +import * as TooltipPrimitive from '@radix-ui/react-tooltip'; import {IconButton, Tooltip} from '@radix-ui/themes'; import {useTheme} from 'next-themes'; import {Fragment} from 'react'; @@ -22,32 +23,34 @@ export function ThemeToggle({ } `} - - { - // Set 'system' theme if the next theme matches the system theme - const resolvedTheme = theme === 'system' ? systemTheme : theme; - const newTheme = resolvedTheme === 'dark' ? 'light' : 'dark'; - const newThemeMatchesSystem = newTheme === systemTheme; - setTheme(newThemeMatchesSystem ? 'system' : newTheme); - }} - {...props} - > - - - - + + + { + // Set 'system' theme if the next theme matches the system theme + const resolvedTheme = theme === 'system' ? systemTheme : theme; + const newTheme = resolvedTheme === 'dark' ? 'light' : 'dark'; + const newThemeMatchesSystem = newTheme === systemTheme; + setTheme(newThemeMatchesSystem ? 'system' : newTheme); + }} + {...props} + > + + + + + ); }