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
|
import * as React from "react";
import {
TouchableOpacity,
StyleSheet,
GestureResponderEvent,
Text,
} from "react-native";
export interface ButtonProps {
text: string;
onClick?: (event: GestureResponderEvent) => void;
}
export function Button({ text, onClick }: ButtonProps) {
return (
<TouchableOpacity style={styles.button} onPress={onClick}>
<Text style={styles.text}>{text}</Text>
</TouchableOpacity>
);
}
const styles = StyleSheet.create({
button: {
maxWidth: 200,
textAlign: "center",
borderRadius: 10,
paddingTop: 14,
paddingBottom: 14,
paddingLeft: 30,
paddingRight: 30,
fontSize: "15px",
backgroundColor: "#2f80ed",
},
text: {
color: "white",
},
});
|