|
@@ -1,95 +1,18 @@
|
1
|
1
|
// @flow
|
2
|
2
|
|
3
|
3
|
import * as React from 'react';
|
4
|
|
-import {Root, StyleProvider, Text} from 'native-base';
|
5
|
|
-import {Image, StyleSheet, View} from 'react-native'
|
|
4
|
+import {Root, StyleProvider} from 'native-base';
|
|
5
|
+import {View} from 'react-native'
|
6
|
6
|
import AppNavigator from './navigation/AppNavigator';
|
7
|
7
|
import ThemeManager from './utils/ThemeManager';
|
8
|
8
|
import LocaleManager from './utils/LocaleManager';
|
9
|
9
|
import * as Font from 'expo-font';
|
10
|
|
-import {LinearGradient} from 'expo-linear-gradient';
|
11
|
|
-import AppIntroSlider from 'react-native-app-intro-slider';
|
12
|
10
|
// edited native-base-shoutem-theme according to
|
13
|
11
|
// https://github.com/GeekyAnts/theme/pull/5/files/91f67c55ca6e65fe3af779586b506950c9f331be#diff-4cfc2dd4d5dae7954012899f2268a422
|
14
|
12
|
// to allow for dynamic theme switching
|
15
|
13
|
import {clearThemeCache} from 'native-base-shoutem-theme';
|
16
|
14
|
import AsyncStorageManager from "./utils/AsyncStorageManager";
|
17
|
|
-import CustomMaterialIcon from "./components/CustomMaterialIcon";
|
18
|
|
-import SideBar from "./components/Sidebar";
|
19
|
|
-import SideMenu from "react-native-side-menu";
|
20
|
|
-
|
21
|
|
-const styles = StyleSheet.create({
|
22
|
|
- mainContent: {
|
23
|
|
- flex: 1,
|
24
|
|
- alignItems: 'center',
|
25
|
|
- justifyContent: 'center',
|
26
|
|
- paddingBottom: 100
|
27
|
|
- },
|
28
|
|
- image: {
|
29
|
|
- width: 200,
|
30
|
|
- height: 200,
|
31
|
|
- },
|
32
|
|
- text: {
|
33
|
|
- color: 'rgba(255, 255, 255, 0.8)',
|
34
|
|
- backgroundColor: 'transparent',
|
35
|
|
- textAlign: 'center',
|
36
|
|
- paddingHorizontal: 16,
|
37
|
|
- },
|
38
|
|
- title: {
|
39
|
|
- fontSize: 22,
|
40
|
|
- color: 'white',
|
41
|
|
- backgroundColor: 'transparent',
|
42
|
|
- textAlign: 'center',
|
43
|
|
- marginBottom: 16,
|
44
|
|
- },
|
45
|
|
-});
|
46
|
|
-
|
47
|
|
-// Content to be used int the intro slides
|
48
|
|
-const slides = [
|
49
|
|
- {
|
50
|
|
- key: '1',
|
51
|
|
- title: 'Bienvenue sur COFFEE',
|
52
|
|
- text: ' La nouvelle app à consulter pendant la pause café pour être au courant de la vie du campus !',
|
53
|
|
- image: require('./assets/drawer-cover.png'),
|
54
|
|
- colors: ['#e01928', '#be1522'],
|
55
|
|
- },
|
56
|
|
- {
|
57
|
|
- key: '2',
|
58
|
|
- title: 'Restez informés',
|
59
|
|
- text: 'COFFEE vous permettra bientôt d\'être au courant de tous les événements qui ont lieu sur le campus, de la vente de crêpes jusqu\'aux concerts enfoiros !',
|
60
|
|
- icon: 'calendar-range',
|
61
|
|
- colors: ['#d99e09', '#c28d08'],
|
62
|
|
- },
|
63
|
|
- {
|
64
|
|
- key: '3',
|
65
|
|
- title: 'N\'oubliez plus votre linge !',
|
66
|
|
- text: 'COFFEE vous informe de la disponibilité des machines et vous permet d\'être notifiés lorsque la vôtre se termine bientôt !',
|
67
|
|
- icon: 'washing-machine',
|
68
|
|
- colors: ['#1fa5ee', '#1c97da'],
|
69
|
|
- },
|
70
|
|
- {
|
71
|
|
- key: '4',
|
72
|
|
- title: 'Proximo',
|
73
|
|
- text: 'Il vous manque des pâtes ? Ou un petit creux au gouter, regardez les stocks de votre supérette insaienne en temps réel',
|
74
|
|
- icon: 'shopping',
|
75
|
|
- colors: ['#ec5904', '#da5204'],
|
76
|
|
- },
|
77
|
|
- {
|
78
|
|
- key: '5',
|
79
|
|
- title: 'Planex',
|
80
|
|
- text: 'Consultez votre emploi du temps sur COFFEE',
|
81
|
|
- icon: 'timetable',
|
82
|
|
- colors: ['#7c33ec', '#732fda'],
|
83
|
|
- },
|
84
|
|
- {
|
85
|
|
- key: '6',
|
86
|
|
- title: 'Toujours en développement',
|
87
|
|
- text: 'D\'autres fonctionnalités arrivent bientôt, n\'hésitez pas à nous donner votre avis pour améliorer l\'appli',
|
88
|
|
- icon: 'cogs',
|
89
|
|
- colors: ['#37c13e', '#26852b'],
|
90
|
|
- },
|
91
|
|
-];
|
92
|
|
-
|
|
15
|
+import CustomIntroSlider from "./components/CustomIntroSlider";
|
93
|
16
|
|
94
|
17
|
type Props = {};
|
95
|
18
|
|
|
@@ -144,33 +67,6 @@ export default class App extends React.Component<Props, State> {
|
144
|
67
|
}
|
145
|
68
|
|
146
|
69
|
/**
|
147
|
|
- * Render item to be used for the intro slides
|
148
|
|
- * @param item
|
149
|
|
- * @param dimensions
|
150
|
|
- */
|
151
|
|
- getIntroRenderItem(item: Object, dimensions: Object) {
|
152
|
|
- return (
|
153
|
|
- <LinearGradient
|
154
|
|
- style={[
|
155
|
|
- styles.mainContent,
|
156
|
|
- dimensions,
|
157
|
|
- ]}
|
158
|
|
- colors={item.colors}
|
159
|
|
- start={{x: 0, y: 0.1}}
|
160
|
|
- end={{x: 0.1, y: 1}}
|
161
|
|
- >
|
162
|
|
- {item.image !== undefined ?
|
163
|
|
- <Image source={item.image} style={styles.image}/>
|
164
|
|
- : <CustomMaterialIcon icon={item.icon} color={'#fff'} fontSize={200} width={200}/>}
|
165
|
|
- <View style={{marginTop: 20}}>
|
166
|
|
- <Text style={styles.title}>{item.title}</Text>
|
167
|
|
- <Text style={styles.text}>{item.text}</Text>
|
168
|
|
- </View>
|
169
|
|
- </LinearGradient>
|
170
|
|
- );
|
171
|
|
- }
|
172
|
|
-
|
173
|
|
- /**
|
174
|
70
|
* Callback when user ends the intro. Save in preferences to avaoid showing back the slides
|
175
|
71
|
*/
|
176
|
72
|
onIntroDone() {
|
|
@@ -186,18 +82,15 @@ export default class App extends React.Component<Props, State> {
|
186
|
82
|
return <View/>;
|
187
|
83
|
}
|
188
|
84
|
if (this.state.showIntro) {
|
189
|
|
- return <AppIntroSlider renderItem={({item, dimensions}) => this.getIntroRenderItem(item, dimensions)}
|
190
|
|
- slides={slides} onDone={() => this.onIntroDone()} bottomButton showSkipButton/>;
|
|
85
|
+ return <CustomIntroSlider onDone={() => this.onIntroDone()}/>;
|
191
|
86
|
} else {
|
192
|
87
|
return (
|
193
|
88
|
<Root>
|
194
|
89
|
<StyleProvider style={this.state.currentTheme}>
|
195
|
|
- <AppNavigator/>
|
|
90
|
+ <AppNavigator/>
|
196
|
91
|
</StyleProvider>
|
197
|
92
|
</Root>
|
198
|
93
|
);
|
199
|
94
|
}
|
200
|
95
|
}
|
201
|
|
-
|
202
|
|
- menu = <View/>;
|
203
|
96
|
}
|