-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
48 lines (41 loc) · 1.54 KB
/
Copy pathApp.js
File metadata and controls
48 lines (41 loc) · 1.54 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
import React, { PureComponent } from 'react';
import { SafeAreaView, View, Text, TouchableOpacity, StatusBar } from 'react-native';
import QuelleHistoireAventures from '@wemap/quelle-histoire-aventures-core';
import { theme } from '@wemap/quelle-histoire-aventures-material';
import { gameDataSet } from './src/Constants';
class App extends PureComponent {
state = {
openGame: false,
};
_onClick = () => {
this.setState({ openGame: true });
};
_onClose = () => {
this.setState({ openGame: false });
};
render() {
const { openGame } = this.state;
return (
<>
<StatusBar barStyle="dark-content" />
{openGame ? (
<QuelleHistoireAventures
gameDataSet={gameDataSet}
theme={theme}
onGameEnd={this._onClose}
debug
/>
) : (
<SafeAreaView style={{ flex: 1 }}>
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<TouchableOpacity style={{ backgroundColor: 'grey', padding: 30, borderRadius: 15, width: '50%' }} onPress={this._onClick}>
<Text style={{ textAlign: 'center', fontSize: 20 }}>START</Text>
</TouchableOpacity>
</View>
</SafeAreaView>
)}
</>
);
}
}
export default App;