Massive/use-dark.ts

12 lines
287 B
TypeScript
Raw Normal View History

2023-06-27 03:16:59 +00:00
import { useColorScheme } from 'react-native'
import { useTheme } from './use-theme'
export default function useDark() {
2022-10-31 04:22:08 +00:00
const dark = useColorScheme() === 'dark'
2023-06-27 03:16:59 +00:00
const { theme } = useTheme()
if (theme === 'dark') return true
if (theme === 'light') return false
2022-10-31 04:22:08 +00:00
return dark
}