selection chantier (animation,correction) ; ajustement et amélioration du thème ; chantier provider
This commit is contained in:
@@ -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} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user