traintrape-moi/client/components/ThemedView.tsx

14 lines
460 B
TypeScript
Raw Normal View History

2024-12-07 09:24:41 +00:00
import { View, type ViewProps } from 'react-native'
import { useThemeColor } from '@/hooks/useThemeColor'
2024-12-01 11:29:47 +00:00
export type ThemedViewProps = ViewProps & {
2024-12-07 09:24:41 +00:00
lightColor?: string
darkColor?: string
}
2024-12-01 11:29:47 +00:00
export function ThemedView({ style, lightColor, darkColor, ...otherProps }: ThemedViewProps) {
2024-12-07 09:24:41 +00:00
const backgroundColor = useThemeColor({ light: lightColor, dark: darkColor }, 'background')
2024-12-01 11:29:47 +00:00
2024-12-07 09:24:41 +00:00
return <View style={[{ backgroundColor }, style]} {...otherProps} />
2024-12-01 11:29:47 +00:00
}