-
Notifications
You must be signed in to change notification settings - Fork 0
/
stylebutton.tsx
60 lines (56 loc) · 1.37 KB
/
stylebutton.tsx
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import React, {useEffect} from 'react';
import {useState} from 'react';
import {
Text, //First letter Capital
View,
Button,
StyleSheet,
TextInput,
FlatList,
ScrollView,
KeyboardAvoidingView,
TouchableHighlight,
} from 'react-native';
const App = () => {
return (
<View style={styles.main}>
<TouchableHighlight>
<Text style={[styles.button, styles.success]}>Success</Text>
</TouchableHighlight>
<TouchableHighlight>
<Text style={[styles.button, styles.primary]}>Primary</Text>
</TouchableHighlight>
<TouchableHighlight>
<Text style={[styles.button, styles.warning]}>Warning</Text>
</TouchableHighlight>
<TouchableHighlight>
<Text style={[styles.button, styles.error]}>Error</Text>
</TouchableHighlight>
<TouchableHighlight>
<Text style={styles.button}>Button</Text>
</TouchableHighlight>
</View>
);
};
const styles = StyleSheet.create({
main: {
flex: 1,
},
button: {
backgroundColor: '#bbb',
color: '#fff',
fontSize: 24,
textAlign: 'center',
padding: 10,
margin: 10,
borderRadius: 10,
shadowColor: 'blue',
elevation: 10,
shadowOpacity: 1,
},
success: {backgroundColor: 'green'},
primary: {backgroundColor: 'skyblue'},
warning: {backgroundColor: 'gold'},
error: {backgroundColor: 'red'},
});
export default App;