-
Notifications
You must be signed in to change notification settings - Fork 2
/
App.js
48 lines (45 loc) · 1.09 KB
/
App.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
36
37
38
39
40
41
42
43
44
45
46
47
48
import { StatusBar } from 'expo-status-bar';
import { useState } from 'react';
import { Pressable, StyleSheet, Text, View } from 'react-native';
export default function App() {
const [clicked, setClicked] = useState(false);
return (
<View style={styles.container}>
{!clicked && (
<Pressable testID="click-me-button" style={styles.button} onPress={() => setClicked(true)}>
<Text style={styles.text}>Click me</Text>
</Pressable>
)}
{clicked && <Text style={styles.hi}>Hi!</Text>}
<StatusBar style="auto" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
hi: {
fontSize: 30,
color: '#4630EB',
},
button: {
alignItems: 'center',
justifyContent: 'center',
paddingVertical: 12,
paddingHorizontal: 32,
borderRadius: 4,
elevation: 3,
backgroundColor: '#4630EB',
},
text: {
fontSize: 16,
lineHeight: 21,
fontWeight: 'bold',
letterSpacing: 0.25,
color: 'white',
},
});