2022-11-01 03:50:03 +00:00
|
|
|
import {createContext, useContext} from 'react'
|
2022-11-26 00:15:12 +00:00
|
|
|
import {DarkTheme, DefaultTheme} from 'react-native-paper'
|
2022-11-01 03:50:03 +00:00
|
|
|
|
|
|
|
export const ThemeContext = createContext<{
|
|
|
|
theme: string
|
2022-11-26 00:15:12 +00:00
|
|
|
lightColor: string
|
2022-11-01 03:50:03 +00:00
|
|
|
setTheme: (value: string) => void
|
2022-11-26 00:15:12 +00:00
|
|
|
setLightColor: (value: string) => void
|
|
|
|
darkColor: string
|
|
|
|
setDarkColor: (value: string) => void
|
2022-11-01 03:50:03 +00:00
|
|
|
}>({
|
2022-11-20 08:47:05 +00:00
|
|
|
theme: 'system',
|
2022-11-26 00:15:12 +00:00
|
|
|
lightColor: DefaultTheme.colors.primary,
|
2022-11-01 03:50:03 +00:00
|
|
|
setTheme: () => null,
|
2022-11-26 00:15:12 +00:00
|
|
|
setLightColor: () => null,
|
|
|
|
darkColor: DarkTheme.colors.primary,
|
|
|
|
setDarkColor: () => null,
|
2022-11-01 03:50:03 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
export function useTheme() {
|
|
|
|
return useContext(ThemeContext)
|
|
|
|
}
|