This commit is contained in:
trochas
2025-12-11 13:02:45 +01:00
parent bce1ea92a2
commit dae973b3fc
4 changed files with 43 additions and 17 deletions

View File

@@ -15,6 +15,7 @@ export type ThemedPressableProps = PressableProps & {
export function ThemedButton({ style, lightColor, darkColor,lvl=1,border=-1,opacity="FF",shadow=false, ...otherProps }: ThemedPressableProps) {
var lvlStr:string = "background";
var borderColor ="";
var borderWidth = 0;
if(lvl>=0 && lvl<6){
lvlStr+=lvl;
}
@@ -28,6 +29,7 @@ export function ThemedButton({ style, lightColor, darkColor,lvl=1,border=-1,opac
if(border>=0 && border<6){
borderStr="background"+border;
borderColor = useThemeColor({ light: lightColor, dark: darkColor },borderStr as 'background0'|'background1'|'background2'|'background3'|'background4'|'background5');
borderWidth = 2;
}
else{
borderColor = backgroundColor
@@ -44,5 +46,5 @@ export function ThemedButton({ style, lightColor, darkColor,lvl=1,border=-1,opac
shadowRadius: 6,
}
return <Pressable style={(state) =>[{ backgroundColor, borderColor }, shadow && shadowStyle, typeof style === 'function' ? style(state) : style,]} {...otherProps}/>;
return <Pressable style={(state) =>[{ backgroundColor, borderColor, borderWidth }, shadow && shadowStyle, typeof style === 'function' ? style(state) : style,]} {...otherProps}/>;
}