Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

use-theme.ts 352B

12345678910111213
  1. import { Theme } from '@/types/app'
  2. import { useTheme as useBaseTheme } from 'next-themes'
  3. const useTheme = () => {
  4. const { theme, resolvedTheme, ...rest } = useBaseTheme()
  5. return {
  6. // only returns 'light' or 'dark' theme
  7. theme: theme === Theme.system ? resolvedTheme as Theme : theme as Theme,
  8. ...rest,
  9. }
  10. }
  11. export default useTheme