-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
101 lines (93 loc) · 2.54 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
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import React from 'react';
import { useState } from 'react';
import { View, Text, StyleSheet, Image, TouchableOpacity, Dimensions } from 'react-native';
import LeaderboardScreen from './components/LeaderboardScreen';
import LoginScreen from './components/LoginScreen';
import QuestionManager from './components/QuestionManager';
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
},
buttonContainer: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
width: '100%',
height: 50,
padding: 10,
marginTop: '15%',
marginLeft: '15%',
marginRight: '15%',
marginBottom: '15%',
zIndex: '10',
},
button: {
width: '30%',
height: 40,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#7b8d9d',
borderRadius: 5,
marginHorizontal: 5,
},
buttonText: {
color: 'white',
fontWeight: 'bold',
fontSize: 16,
},
questionText: {
textAlign: 'center',
fontSize: 30,
fontWeight: 'bold',
marginBottom: '5%'
},
answerButtonContainer: {
alignItems: 'center',
width: '100%',
height: '20%',
padding: 10,
marginTop: '15%',
},
answerButton: {
width: '90%',
height: 60,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#7b8d9d',
borderRadius: 5,
marginHorizontal: 5,
marginVertical: 10,
},
bulbImage: {
height: 1000,
width: 1000,
position: 'absolute',
zIndex: '-10',
}
});
const App = () => {
const [currentScreen, setCurrentScreen] = useState('question');
return (
<View style={styles.container}>
<View style={styles.buttonContainer}>
<TouchableOpacity onPress={() => setCurrentScreen('leaderboard')} style={styles.button}>
<Text style={styles.buttonText}>Leaderboard</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => setCurrentScreen('question')} style={styles.button}>
<Text style={styles.buttonText}>Play</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => setCurrentScreen('login')} style={styles.button}>
<Text style={styles.buttonText}>Log In</Text>
</TouchableOpacity>
</View>
{currentScreen === 'question' &&
<QuestionManager />}
{currentScreen === 'leaderboard' && <LeaderboardScreen />}
{currentScreen === 'login' && <LoginScreen />}
<Image source={require('./images/71.jpg')}
style={styles.bulbImage}/>
</View>
);
}
export default App;