Made button visually responsive on pressing

This commit is contained in:
Keannu Bernasol 2023-10-15 11:44:31 +08:00
parent de33fe30fd
commit 8867306bd0

View file

@ -17,7 +17,10 @@ export default function Button({ disabled = false, ...props }: props) {
<Pressable <Pressable
disabled={disabled} disabled={disabled}
onPress={props.onPress} onPress={props.onPress}
style={{ ...styles.button_template, ...{ backgroundColor: props.color } }} style={({ pressed }) => [
styles.button_template,
{ backgroundColor: pressed ? colors.primary_2 : props.color },
]}
> >
{props.children} {props.children}
</Pressable> </Pressable>