mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2024-11-17 06:19:25 +08:00
Made button visually responsive on pressing
This commit is contained in:
parent
de33fe30fd
commit
8867306bd0
1 changed files with 4 additions and 1 deletions
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue