selection chantier (animation,correction) ; ajustement et amélioration du thème ; chantier provider

This commit is contained in:
Rochas
2025-12-06 22:33:01 +01:00
parent a10b2fa953
commit c581f1511f
9 changed files with 321 additions and 151 deletions

View File

@@ -1,4 +1,4 @@
import { View, type ViewProps } from 'react-native';
import { View, ViewStyle, type ViewProps } from 'react-native';
import { useThemeColor } from '@/hooks/use-theme-color';
@@ -8,11 +8,12 @@ export type ThemedViewProps = ViewProps & {
lvl?:number;
border?:number;
opacity?:string;
shadow?: boolean;
};
//nb : pour border ne pas oublier de mettre en plus "borderWidth" dans le style du composant /!\
export function ThemedView({ style, lightColor, darkColor,lvl=1,border=-1,opacity="FF", ...otherProps }: ThemedViewProps) {
export function ThemedView({ style, lightColor, darkColor,lvl=1,border=-1,opacity="FF",shadow=false, ...otherProps }: ThemedViewProps) {
var lvlStr:string = "background";
var borderColor ="";
if(lvl>=0 && lvl<6){
@@ -34,7 +35,15 @@ export function ThemedView({ style, lightColor, darkColor,lvl=1,border=-1,opacit
}
}
const shadowStyle: ViewStyle = {
//android
elevation: 10,
//iOS
shadowColor: '#000',
shadowOffset: { width: 0, height: 4 },
shadowOpacity: 0.2,
shadowRadius: 6,
}
return <View style={[{ backgroundColor, borderColor }, style]} {...otherProps} />;
return <View style={[{ backgroundColor, borderColor }, shadow && shadowStyle, style]} {...otherProps} />;
}