Massive/use-dark.ts
Brandon Presley 31f1528c35 Replace settings context with theme context
The settings context was having a big performance
impact on the app. We only truly need the theme + color
to be a global context.
2022-11-01 16:50:03 +13:00

12 lines
281 B
TypeScript

import {useColorScheme} from 'react-native'
import {useTheme} from './use-theme'
export default function useDark() {
const dark = useColorScheme() === 'dark'
const {theme} = useTheme()
if (theme === 'dark') return true
if (theme === 'light') return false
return dark
}