This commit is contained in:
Maarten 2024-08-08 14:22:35 +02:00
parent cec664c8d0
commit ff2320f08c
13 changed files with 297 additions and 297 deletions

View file

@ -4,5 +4,5 @@
// to render different styles on the client and server, these aren't directly supported in React Native
// but can be achieved using a styling library like Nativewind.
export function useColorScheme() {
return 'light';
return 'light';
}

View file

@ -8,15 +8,15 @@ import { useColorScheme } from 'react-native';
import { Colors } from '@/constants/Colors';
export function useThemeColor(
props: { light?: string; dark?: string },
colorName: keyof typeof Colors.light & keyof typeof Colors.dark
props: { light?: string; dark?: string },
colorName: keyof typeof Colors.light & keyof typeof Colors.dark
) {
const theme = useColorScheme() ?? 'light';
const colorFromProps = props[theme];
const theme = useColorScheme() ?? 'light';
const colorFromProps = props[ theme ];
if (colorFromProps) {
return colorFromProps;
} else {
return Colors[theme][colorName];
}
if (colorFromProps) {
return colorFromProps;
} else {
return Colors[ theme ][ colorName ];
}
}