-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathButton.js
More file actions
41 lines (37 loc) · 866 Bytes
/
Button.js
File metadata and controls
41 lines (37 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { Pressable, StyleSheet, Text, View } from 'react-native';
import { Colors } from '../../constants/styles';
function Button({ children, onPress }) {
return (
<Pressable
style={({ pressed }) => [styles.button, pressed && styles.pressed]}
onPress={onPress}
>
<View>
<Text style={styles.buttonText}>{children}</Text>
</View>
</Pressable>
);
}
export default Button;
const styles = StyleSheet.create({
button: {
borderRadius: 6,
paddingVertical: 6,
paddingHorizontal: 12,
backgroundColor: Colors.primary500,
elevation: 2,
shadowColor: 'black',
shadowOffset: { width: 1, height: 1 },
shadowOpacity: 0.25,
shadowRadius: 4,
},
pressed: {
opacity: 0.7,
},
buttonText: {
textAlign: 'center',
color: 'white',
fontSize: 16,
fontWeight: 'bold'
},
});