summaryrefslogtreecommitdiffstats
path: root/components/themed-view.tsx
blob: 6f181d826ea41908e90f5fec0aefd7332111496e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { View, type ViewProps } from 'react-native';

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

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} />;
}