forked from Crowdhackathon-SmartCity2/movability
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathButton.js
35 lines (33 loc) · 897 Bytes
/
Button.js
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
import React, { Component } from "react";
import {
StyleSheet, // CSS-like styles
Text, // Renders text
TouchableOpacity, // Pressable container
View // Container component
} from "react-native";
export default class Button extends Component {
render({ onPress } = this.props) {
return (
<TouchableOpacity onPress={onPress}>
<View style={styles.button}>
<Text style={styles.text}>{this.props.text.toUpperCase()}</Text>
</View>
</TouchableOpacity>
);
}
}
const styles = StyleSheet.create({
// Button container
button: {
borderRadius: 50, // Rounded border
borderWidth: 2, // 2 point border widht
borderColor: "#FFFFFF", // White colored border
paddingHorizontal: 50, // Horizontal padding
paddingVertical: 10 // Vertical padding
},
// Button text
text: {
color: "#FFFFFF",
fontWeight: "bold",
}
});