Browse Source

Updated intro slide and added settings and about buttons

keplyx 4 years ago
parent
commit
1cb68a0d15

+ 26
- 11
App.js View File

@@ -48,30 +48,44 @@ const styles = StyleSheet.create({
48 48
 const slides = [
49 49
     {
50 50
         key: '1',
51
-        title: 'L\'application de l\'Amicale',
52
-        text: 'Toutes les informations du campus de Toulouse',
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 53
         image: require('./assets/amicale.png'),
54 54
         colors: ['#ff8a6d', '#aa1c0d'],
55 55
     },
56 56
     {
57 57
         key: '2',
58
-        title: 'N\'oubliez plus votre linge',
59
-        text: 'Visualisez les disponibilités des machines et rajoutez des alarmes',
60
-        icon: 'washing-machine',
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 61
         colors: ['#9cd6d3', '#3186be'],
62 62
     },
63 63
     {
64 64
         key: '3',
65
-        title: 'Le proximo',
66
-        text: 'Regardez le stock de la supérette de l\'INSA depuis n\'importe où',
67
-        icon: 'shopping',
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 68
         colors: ['#f9a967', '#da5204'],
69 69
     },
70 70
     {
71 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: ['#f9a967', '#da5204'],
76
+    },
77
+    {
78
+        key: '5',
79
+        title: 'Planex',
80
+        text: 'Consultez votre emploi du temps sur COFFEE',
81
+        icon: 'timetable',
82
+        colors: ['#f9a967', '#da5204'],
83
+    },
84
+    {
85
+        key: '6',
72 86
         title: 'Toujours en développement',
73
-        text: 'D\'autres fonctionnalités seront disponibles prochainement',
74
-        icon: 'settings-outline',
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',
75 89
         colors: ['#9be238', '#1e6a22'],
76 90
     },
77 91
 ];
@@ -114,7 +128,8 @@ export default class App extends React.Component<Props, State> {
114 128
         this.setState({
115 129
             isLoading: false,
116 130
             currentTheme: ThemeManager.getCurrentTheme(),
117
-            showIntro: AsyncStorageManager.getInstance().preferences.showIntro.current === '1'
131
+            // showIntro: AsyncStorageManager.getInstance().preferences.showIntro.current === '1'
132
+            showIntro: true
118 133
         });
119 134
     }
120 135
 

+ 2
- 2
components/BaseContainer.js View File

@@ -13,7 +13,7 @@ import Touchable from "react-native-platform-touchable";
13 13
 type Props = {
14 14
     navigation: Object,
15 15
     headerTitle: string,
16
-    headerRightMenu: React.Node,
16
+    headerRightButton: React.Node,
17 17
     children: React.Node
18 18
 }
19 19
 
@@ -61,7 +61,7 @@ export default class BaseContainer extends React.Component<Props, State> {
61 61
                                               icon="menu"/>
62 62
                                       </Touchable>
63 63
                                   }
64
-                    rightMenu={this.props.headerRightMenu}/>
64
+                    rightButton={this.props.headerRightButton}/>
65 65
                     {this.props.children}
66 66
                 </Container>
67 67
             </CustomSideMenu>

+ 13
- 3
components/CustomHeader.js View File

@@ -11,7 +11,7 @@ import CustomMaterialIcon from "./CustomMaterialIcon";
11 11
 type Props = {
12 12
     hasBackButton: boolean,
13 13
     leftButton: React.Node,
14
-    rightMenu: React.Node,
14
+    rightButton: React.Node,
15 15
     title: string,
16 16
     navigation: Object,
17 17
     hasTabs: boolean,
@@ -30,7 +30,7 @@ export default class CustomHeader extends React.Component<Props> {
30 30
     static defaultProps = {
31 31
         hasBackButton: false,
32 32
         leftButton: <View/>,
33
-        rightMenu: <Right/>,
33
+        rightButton: <View/>,
34 34
         hasTabs: false,
35 35
     };
36 36
 
@@ -57,7 +57,17 @@ export default class CustomHeader extends React.Component<Props> {
57 57
                 <Body>
58 58
                     <Title>{this.props.title}</Title>
59 59
                 </Body>
60
-                {this.props.rightMenu}
60
+                <Right>
61
+                    {this.props.rightButton}
62
+                    {this.props.hasBackButton ? <View/> :
63
+                    <Touchable
64
+                        style={{padding: 6}}
65
+                        onPress={() => this.props.navigation.navigate('SettingsScreen')}>
66
+                        <CustomMaterialIcon
67
+                            color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}
68
+                            icon="settings"/>
69
+                    </Touchable>}
70
+                </Right>
61 71
             </Header>);
62 72
     }
63 73
 };

+ 4
- 2
navigation/AppNavigator.js View File

@@ -1,9 +1,9 @@
1 1
 // @flow
2 2
 
3 3
 import {createAppContainer, createStackNavigator} from 'react-navigation';
4
-
5
-import MainDrawerNavigator from './MainDrawerNavigator';
6 4
 import MainTabNavigator from './MainTabNavigator';
5
+import SettingsScreen from '../screens/SettingsScreen';
6
+import AboutScreen from '../screens/About/AboutScreen';
7 7
 import ProximoListScreen from '../screens/Proximo/ProximoListScreen';
8 8
 import AboutDependenciesScreen from '../screens/About/AboutDependenciesScreen';
9 9
 
@@ -15,6 +15,8 @@ export default createAppContainer(
15 15
             Tabs: MainTabNavigator,
16 16
             // Drawer: MainDrawerNavigator,
17 17
             ProximoListScreen: {screen: ProximoListScreen},
18
+            SettingsScreen: {screen: SettingsScreen},
19
+            AboutScreen: {screen: AboutScreen},
18 20
             AboutDependenciesScreen: {screen: AboutDependenciesScreen},
19 21
         },
20 22
         {

+ 1
- 1
navigation/MainTabNavigator.js View File

@@ -9,7 +9,7 @@ import PlanexScreen from '../screens/PlanexScreen';
9 9
 import CustomMaterialIcon from "../components/CustomMaterialIcon";
10 10
 
11 11
 const TAB_ICONS = {
12
-    Home: 'home',
12
+    Home: 'coffee',
13 13
     Planning: 'calendar-range',
14 14
     Proxiwash: 'washing-machine',
15 15
     Proximo: 'shopping',

+ 1
- 1
screens/About/AboutScreen.js View File

@@ -163,7 +163,7 @@ export default class AboutScreen extends React.Component<Props> {
163 163
         const nav = this.props.navigation;
164 164
         return (
165 165
             <Container>
166
-                <CustomHeader navigation={nav} title={i18n.t('screens.about')}/>
166
+                <CustomHeader navigation={nav} title={i18n.t('screens.about')} hasBackButton={true}/>
167 167
                 <Content padder>
168 168
                     <Card>
169 169
                         <CardItem>

+ 9
- 12
screens/PlanexScreen.js View File

@@ -2,8 +2,7 @@
2 2
 
3 3
 import * as React from 'react';
4 4
 import {Platform, View} from 'react-native';
5
-import {Container, Right, Spinner} from 'native-base';
6
-import CustomHeader from "../components/CustomHeader";
5
+import {Spinner} from 'native-base';
7 6
 import WebView from "react-native-webview";
8 7
 import Touchable from "react-native-platform-touchable";
9 8
 import CustomMaterialIcon from "../components/CustomMaterialIcon";
@@ -36,15 +35,13 @@ export default class PlanningScreen extends React.Component<Props, State> {
36 35
 
37 36
     getRefreshButton() {
38 37
         return (
39
-            <Right>
40
-                <Touchable
41
-                    style={{padding: 6}}
42
-                    onPress={() => this.refreshWebview()}>
43
-                    <CustomMaterialIcon
44
-                        color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}
45
-                        icon="refresh"/>
46
-                </Touchable>
47
-            </Right>
38
+            <Touchable
39
+                style={{padding: 6}}
40
+                onPress={() => this.refreshWebview()}>
41
+                <CustomMaterialIcon
42
+                    color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}
43
+                    icon="refresh"/>
44
+            </Touchable>
48 45
         );
49 46
     };
50 47
 
@@ -56,7 +53,7 @@ export default class PlanningScreen extends React.Component<Props, State> {
56 53
     render() {
57 54
         const nav = this.props.navigation;
58 55
         return (
59
-            <BaseContainer navigation={nav} headerTitle={'Planex'} headerRightMenu={this.getRefreshButton()}>
56
+            <BaseContainer navigation={nav} headerTitle={'Planex'} headerRightButton={this.getRefreshButton()}>
60 57
                 <WebView
61 58
                     ref={ref => (this.webview = ref)}
62 59
                     source={{uri: PLANEX_URL}}

+ 16
- 1
screens/SettingsScreen.js View File

@@ -21,6 +21,8 @@ import i18n from "i18n-js";
21 21
 import {NavigationActions, StackActions} from "react-navigation";
22 22
 import CustomMaterialIcon from "../components/CustomMaterialIcon";
23 23
 import AsyncStorageManager from "../utils/AsyncStorageManager";
24
+import Touchable from "react-native-platform-touchable";
25
+import {Platform} from "react-native";
24 26
 
25 27
 type Props = {
26 28
     navigation: Object,
@@ -170,11 +172,24 @@ export default class SettingsScreen extends React.Component<Props, State> {
170 172
         );
171 173
     }
172 174
 
175
+    getRightButton() {
176
+        return (
177
+            <Touchable
178
+                style={{padding: 6}}
179
+                onPress={() => this.props.navigation.navigate('AboutScreen')}>
180
+                <CustomMaterialIcon
181
+                    color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}
182
+                    icon="information"/>
183
+            </Touchable>
184
+        );
185
+    }
186
+
173 187
     render() {
174 188
         const nav = this.props.navigation;
175 189
         return (
176 190
             <Container>
177
-                <CustomHeader navigation={nav} title={i18n.t('screens.settings')}/>
191
+                <CustomHeader navigation={nav} title={i18n.t('screens.settings')} hasBackButton={true}
192
+                rightButton={this.getRightButton()}/>
178 193
                 <Content padder>
179 194
                     <Card>
180 195
                         <CardItem header>

Loading…
Cancel
Save