-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
69 lines (62 loc) · 2.48 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
import {StatusBar} from 'expo-status-bar';
import React, {useState} from 'react';
import {StyleSheet, Text, View, SafeAreaView, ImageBackground, Pressable} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import ScreenTemplate from "./screens/_screenTemplate";
export default function App() {
const Stack = createNativeStackNavigator();
function MainPage({navigation}) {
return (
<SafeAreaView style={{flex: 1, width: '100%', height: '100%'}}>
<ImageBackground
style={{flex: 1, width: '100%', height: '100%', alignItems: 'center',
justifyContent: 'center'}}
imageStyle={{resizeMode: 'repeat'}}
source={require('./assets/bg.png')}>
<Pressable
style={({ pressed }) => [
styles.mpButton,
{opacity: pressed ? 0.5:1}
]}
onPress={() => {
navigation.navigate('SingleGame')
}}
><Text style={styles.mpButtonText}>Single Game</Text></Pressable>
<Pressable
style={({ pressed }) => [
styles.mpButton,
{opacity: pressed ? 0.5:1}
]}
onPress={() => {
navigation.navigate('JoinTournament')
}}
><Text style={styles.mpButtonText}>Join Tournament</Text></Pressable>
<StatusBar style="auto"/>
</ImageBackground>
</SafeAreaView>
);
}
return (
<NavigationContainer>
<Stack.Navigator screenOptions={{headerShown: false}}>
<Stack.Screen name="Home" component={MainPage}/>
<Stack.Screen name="SingleGame" component={ScreenTemplate}/>
<Stack.Screen name="JoinTournament" component={ScreenTemplate}/>
</Stack.Navigator>
</NavigationContainer>
);
}
const styles = StyleSheet.create({
mpButton: {
width: "50%",
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#828',
height: 40,
marginBottom: 10
},
mpButtonText: {
color: '#fff',
}
});