-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
48 lines (46 loc) · 1.33 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 React, { useState } from "react";
import { Text, View, TouchableOpacity } from "react-native";
import styles from "./styles.scss";
export default function App() {
const [pressed, setPressed] = useState(0);
function handlePress() {
setPressed(prevPressed => prevPressed + 1);
}
return (
<View style={{ flex: 1 }}>
<View style={{ flex: 1, backgroundColor: "powderblue" }} />
<View
style={{
flex: 2,
backgroundColor: "skyblue",
display: "flex",
alignItems: "center",
justifyContent: "center"
}}
>
<TouchableOpacity
style={{
backgroundColor: "#444",
paddingTop: 8,
paddingBottom: 8,
paddingLeft: 16,
paddingRight: 16,
borderRadius: 16,
marginBottom: 16
}}
onPress={handlePress}
>
<Text style={{ color: "white" }}>Press</Text>
</TouchableOpacity>
<Text style={{ color: "white" }}>
Button has been pressed:{" "}
<Text style={{ fontWeight: "bold" }}>{pressed}</Text> times
{"\n"}
{"\n"}
<Text className={styles.blue}>Blue TEXT!</Text>
</Text>
</View>
<View style={{ flex: 3, backgroundColor: "steelblue" }} />
</View>
);
}