Import apps/android/src/ui/use-themed-styles.ts
This commit is contained in:
parent
458480a0f3
commit
6aa4e4ac50
|
|
@ -0,0 +1,7 @@
|
|||
import { useMemo } from 'react'
|
||||
import { useTheme, type ThemeColors, type TypographyDensity } from './theme-context'
|
||||
|
||||
export function useThemedStyles<T>(factory: (colors: ThemeColors, density: TypographyDensity) => T): T {
|
||||
const { colors, density } = useTheme()
|
||||
return useMemo(() => factory(colors, density), [colors, density, factory])
|
||||
}
|
||||
Loading…
Reference in New Issue