This repository has been archived by the owner on Oct 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
127 lines (117 loc) · 3.44 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import {createAppContainer} from 'react-navigation'; //@TODO : Check package lint error
import React, {useState} from 'react';
import {View, Text, Image, Dimensions} from 'react-native';
import AppStack from './src/routes/routes';
import AppSlider from './src/canvas/slider/AppSlider';
import Styles from './src/styles/Styles';
const AppContainer = createAppContainer(AppStack);
export default function App() {
const [showRealApp, setShowRealApp] = useState(false);
function _renderItem({item}) {
if (screenWidth <= 320) {
return (
<View style={Styles.slide}>
<View
style={{
flex: 8,
justifyContent: 'space-around',
alignItems: 'center',
}}>
<Image style={Styles.contentPicture} source={item.image} />
</View>
<View style={{flex: 1, alignSelf: 'center'}}>
<Text style={Styles.appTitle}>{item.title}</Text>
</View>
<View style={{flex: 4, alignSelf: 'center'}}>
<Text style={Styles.text}>{item.text}</Text>
</View>
</View>
);
} else {
return (
<View style={Styles.slide}>
<View
style={{
flex: 8,
justifyContent: 'space-around',
alignItems: 'center',
}}>
<Image style={Styles.contentPicture} source={item.image} />
</View>
<View style={{flex: 1, alignSelf: 'center'}}>
<Text style={Styles.appTitle}>{item.title}</Text>
</View>
<View style={{flex: 3, alignSelf: 'center'}}>
<Text style={Styles.text}>{item.text}</Text>
</View>
</View>
);
}
}
function _onDone() {
setShowRealApp(true);
}
if (showRealApp) {
return <AppContainer />;
} else {
return (
<AppSlider
renderItem={_renderItem}
slides={slides}
onDone={_onDone}
showSkipButton
showPrevButton
bottomButton
nextLabel="Suivant"
skipLabel="Passer"
doneLabel="Terminer"
prevLabel="Retour"
onSkip={_onDone}
/>
);
}
}
/*
const App: () => React$Node = () => {
return (
<>
<StatusBar barStyle="dark-content" />
<SafeAreaView>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={styles.scrollView}>
{global.HermesInternal == null ? null : (
<View style={styles.engine}>
<Text style={styles.footer}>Engine: Hermes</Text>
</View>
)}
<View style={styles.body}>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle} >Welcome to PassPréservatif</Text>
</View>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>See Your Changes</Text>
<Text style={styles.sectionDescription}>
<ReloadInstructions />
</Text>
</View>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>Debug</Text>
<Text style={styles.sectionDescription}>
<DebugInstructions />
</Text>
</View>
</View>
</ScrollView>
</SafeAreaView>
</>
);
};
*/