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
disabled={disabled}
onPress={props.onPress}
style={{ ...styles.button_template, ...{ backgroundColor: props.color } }}
style={({ pressed }) => [
styles.button_template,
{ backgroundColor: pressed ? colors.primary_2 : props.color },
]}
>
{props.children}
</Pressable>