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