themed-view.tsx 465 B

1234567891011121314
  1. import { View, type ViewProps } from 'react-native';
  2. import { Colors, ThemeColor } from '@/constants/theme';
  3. export type ThemedViewProps = ViewProps & {
  4. lightColor?: string;
  5. darkColor?: string;
  6. type?: ThemeColor;
  7. };
  8. export function ThemedView({ style, lightColor, darkColor, type, ...otherProps }: ThemedViewProps) {
  9. return <View style={[{ backgroundColor: Colors[type as keyof typeof Colors] as any ??Colors.background }, style]} {...otherProps} />;
  10. }