2022-11-01 03:50:03 +00:00
|
|
|
import {createContext, useContext} from 'react'
|
|
|
|
|
|
|
|
export const ThemeContext = createContext<{
|
|
|
|
theme: string
|
|
|
|
color: string
|
|
|
|
setTheme: (value: string) => void
|
|
|
|
setColor: (value: string) => void
|
|
|
|
}>({
|
2022-11-20 08:47:05 +00:00
|
|
|
theme: 'system',
|
2022-11-01 03:50:03 +00:00
|
|
|
color: '',
|
|
|
|
setTheme: () => null,
|
|
|
|
setColor: () => null,
|
|
|
|
})
|
|
|
|
|
|
|
|
export function useTheme() {
|
|
|
|
return useContext(ThemeContext)
|
|
|
|
}
|