eletrotupi / tcc/ frontend/components/misc/themed-view.tsx68b32b6167f98c0777e1cc816c4065363f24fba4
470 B | 14 lines Raw
1
import { View, type ViewProps } from 'react-native';
2

3
import { useThemeColor } from '@/hooks/use-theme-color';
4

5
export type ThemedViewProps = ViewProps & {
6
  lightColor?: string;
7
  darkColor?: string;
8
};
9

10
export function ThemedView({ style, lightColor, darkColor, ...otherProps }: ThemedViewProps) {
11
  const backgroundColor = useThemeColor({ light: lightColor, dark: darkColor }, 'background');
12

13
  return <View style={[{ backgroundColor }, style]} {...otherProps} />;
14
}