Kliko/lib/components/ThemedIcon.tsx
2024-08-12 09:22:52 +02:00

13 lines
623 B
TypeScript

// You can (explore) the built-in icon families and icons on the web at https://icons.expo.fyi/
import Ionicons from '@expo/vector-icons/Ionicons';
import { type IconProps } from '@expo/vector-icons/build/createIconSet';
import { type ComponentProps } from 'react';
import { useColorScheme } from '@/lib/hooks/useColorScheme';
import { Colors } from '@/lib/constants/Colors';
export function ThemedIcon({ style, ...rest }: IconProps<ComponentProps<typeof Ionicons>['name']>) {
const colorScheme = useColorScheme() ?? 'light';
return <Ionicons color={Colors[ colorScheme ].text} style={[ style ]} {...rest} />;
}