eletrotupi / tcc/ frontend/components/misc/themed-view.tsx456b19fd092a7738a2d69d877441c73fcf10fb14
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
}