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