diff options
| author | Santo Cariotti <santo@dcariotti.me> | 2024-08-28 15:53:21 +0200 | 
|---|---|---|
| committer | Santo Cariotti <santo@dcariotti.me> | 2024-08-28 15:53:21 +0200 | 
| commit | 83643a78b73dee5610be6ad9837fb72e9b944cb7 (patch) | |
| tree | 1eca6bad452656f78879c829181362f3b586d697 /components/ThemedView.tsx | |
Initial commit
Generated by create-expo-app 3.0.0.
Diffstat (limited to 'components/ThemedView.tsx')
| -rw-r--r-- | components/ThemedView.tsx | 14 | 
1 files changed, 14 insertions, 0 deletions
diff --git a/components/ThemedView.tsx b/components/ThemedView.tsx new file mode 100644 index 0000000..4d2cb09 --- /dev/null +++ b/components/ThemedView.tsx @@ -0,0 +1,14 @@ +import { View, type ViewProps } from 'react-native'; + +import { useThemeColor } from '@/hooks/useThemeColor'; + +export type ThemedViewProps = ViewProps & { +  lightColor?: string; +  darkColor?: string; +}; + +export function ThemedView({ style, lightColor, darkColor, ...otherProps }: ThemedViewProps) { +  const backgroundColor = useThemeColor({ light: lightColor, dark: darkColor }, 'background'); + +  return <View style={[{ backgroundColor }, style]} {...otherProps} />; +}  |