theme en cours

This commit is contained in:
trochas
2025-11-06 18:46:32 +01:00
parent 170ac974c2
commit 73eb7b416a
11 changed files with 186 additions and 87 deletions

View File

@@ -5,10 +5,19 @@ import { useThemeColor } from '@/hooks/use-theme-color';
export type ThemedViewProps = ViewProps & {
lightColor?: string;
darkColor?: string;
lvl?:number;
};
export function ThemedView({ style, lightColor, darkColor, ...otherProps }: ThemedViewProps) {
const backgroundColor = useThemeColor({ light: lightColor, dark: darkColor }, 'background');
export function ThemedView({ style, lightColor, darkColor,lvl=1, ...otherProps }: ThemedViewProps) {
var lvlStr:string = "background";
if(lvl>=0 && lvl<6){
lvlStr+=lvl;
}
else lvlStr+='5';
const backgroundColor = useThemeColor({ light: lightColor, dark: darkColor },lvlStr as 'background0'|'background1'|'background2'|'background3'|'background4'|'background5');
return <View style={[{ backgroundColor }, style]} {...otherProps} />;
}