-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
80 lines (73 loc) · 1.84 KB
/
App.js
File metadata and controls
80 lines (73 loc) · 1.84 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import { useState } from "react";
import { StyleSheet, View, Text, TouchableOpacity } from "react-native";
import { Advisor } from "./screens/Advisor";
import { MakeUp } from "./screens/MakeUp";
export default function App() {
const [screen, setScreen] = useState("home");
return (
<View style={styles.container}>
{screen !== "home" && (
<TouchableOpacity style={styles.back} onPress={() => setScreen("home")}>
<Text>{"<"} back</Text>
</TouchableOpacity>
)}
{(() => {
switch (screen) {
case "home":
return (
<View style={styles.controls}>
<TouchableOpacity
style={styles.button}
onPress={() => setScreen("advisor")}
>
<Text>Advisor demo</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.button}
onPress={() => setScreen("makeup")}
>
<Text>MakeUp demo</Text>
</TouchableOpacity>
</View>
);
case "advisor":
return <Advisor />;
case "makeup":
return <MakeUp />;
}
})()}
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
paddingTop: 50,
backgroundColor: "#ecf0f1",
padding: 8,
display: "flex",
},
controls: {
width: "100%",
height: 100,
padding: 20,
display: "flex",
flexDirection: "row",
alignItems: "center",
justifyContent: "center",
gap: 20,
},
button: {
backgroundColor: "#CCCCCC",
display: "flex",
alignItems: "center",
justifyContent: "center",
padding: 20,
},
back: {
backgroundColor: "#CCCCCC",
width: 70,
padding: 10,
},
});