Massive/use-theme.ts
Brandon Presley 38332c193c Fix settings page crashing
Select.tsx was crashing if it couldn't
find a label for the selected value.
2022-11-20 21:47:05 +13:00

18 lines
351 B
TypeScript

import {createContext, useContext} from 'react'
export const ThemeContext = createContext<{
theme: string
color: string
setTheme: (value: string) => void
setColor: (value: string) => void
}>({
theme: 'system',
color: '',
setTheme: () => null,
setColor: () => null,
})
export function useTheme() {
return useContext(ThemeContext)
}