Browse Source

Added planning screen placeholder

keplyx 4 years ago
parent
commit
fb086aac58
4 changed files with 62 additions and 2 deletions
  1. 53
    1
      screens/PlanningScreen.js
  2. 1
    1
      screens/ProxiwashScreen.js
  3. 4
    0
      translations/en.json
  4. 4
    0
      translations/fr.json

+ 53
- 1
screens/PlanningScreen.js View File

1
 // @flow
1
 // @flow
2
 
2
 
3
 import * as React from 'react';
3
 import * as React from 'react';
4
-import {Container, Text} from 'native-base';
4
+import {Button, Container, H3, Text} from 'native-base';
5
 import CustomHeader from "../components/CustomHeader";
5
 import CustomHeader from "../components/CustomHeader";
6
 import i18n from "i18n-js";
6
 import i18n from "i18n-js";
7
+import {Platform, View} from "react-native";
8
+import CustomMaterialIcon from "../components/CustomMaterialIcon";
9
+import ThemeManager from "../utils/ThemeManager";
10
+import {Linking} from "expo";
7
 
11
 
8
 type Props = {
12
 type Props = {
9
     navigation: Object,
13
     navigation: Object,
10
 }
14
 }
11
 
15
 
12
 /**
16
 /**
17
+ * Opens a link in the device's browser
18
+ * @param link The link to open
19
+ */
20
+function openWebLink(link) {
21
+    Linking.openURL(link).catch((err) => console.error('Error opening link', err));
22
+}
23
+
24
+/**
13
  * Class defining the app's planning screen
25
  * Class defining the app's planning screen
14
  */
26
  */
15
 export default class PlanningScreen extends React.Component<Props> {
27
 export default class PlanningScreen extends React.Component<Props> {
18
         return (
30
         return (
19
             <Container>
31
             <Container>
20
                 <CustomHeader navigation={nav} title={i18n.t('screens.planning')}/>
32
                 <CustomHeader navigation={nav} title={i18n.t('screens.planning')}/>
33
+                <View style={{
34
+                    flexGrow: 1,
35
+                    justifyContent: 'center',
36
+                    alignItems: 'center',
37
+                }}>
38
+                    <View style={{
39
+                        justifyContent: 'center',
40
+                        alignItems: 'center',
41
+                        width: '100%',
42
+                        height: 100,
43
+                        marginBottom: 20
44
+                    }}>
45
+                        <CustomMaterialIcon
46
+                            icon={'forklift'}
47
+                            fontSize={100}
48
+                            width={100}
49
+                            color={ThemeManager.getCurrentThemeVariables().fetchedDataSectionListErrorText}/>
50
+                    </View>
51
+
52
+                    <H3 style={{
53
+                        textAlign: 'center',
54
+                        marginRight: 20,
55
+                        marginLeft: 20,
56
+                        color: ThemeManager.getCurrentThemeVariables().fetchedDataSectionListErrorText
57
+                    }}>
58
+                        {i18n.t('planningScreen.wipTitle')}
59
+                    </H3>
60
+                    <Text style={{
61
+                        textAlign: 'center',
62
+                        color: ThemeManager.getCurrentThemeVariables().fetchedDataSectionListErrorText
63
+                    }}>
64
+                        {i18n.t('planningScreen.wipSubtitle')}
65
+                    </Text>
66
+                    {Platform.OS === 'android' ?
67
+                        <Button block style={{marginTop: 20, marginRight: 10, marginLeft: 10}}
68
+                        onPress={() => openWebLink('https://expo.io/@amicaleinsat/application-amicale')}>
69
+                            <Text>Try the beta</Text>
70
+                        </Button>
71
+                        : <View/>}
72
+                </View>
21
             </Container>
73
             </Container>
22
         );
74
         );
23
     }
75
     }

+ 1
- 1
screens/ProxiwashScreen.js View File

42
      * Creates machine state parameters using current theme and translations
42
      * Creates machine state parameters using current theme and translations
43
      */
43
      */
44
     constructor() {
44
     constructor() {
45
-        super(DATA_URL, 1000 * 10); // Refresh every minute
45
+        super(DATA_URL, 1000 * 30); // Refresh every half minute
46
         let colors = ThemeManager.getCurrentThemeVariables();
46
         let colors = ThemeManager.getCurrentThemeVariables();
47
         stateColors[MACHINE_STATES.TERMINE] = colors.proxiwashFinishedColor;
47
         stateColors[MACHINE_STATES.TERMINE] = colors.proxiwashFinishedColor;
48
         stateColors[MACHINE_STATES.DISPONIBLE] = colors.proxiwashReadyColor;
48
         stateColors[MACHINE_STATES.DISPONIBLE] = colors.proxiwashReadyColor;

+ 4
- 0
translations/en.json View File

28
     "listUpdated": "List updated!",
28
     "listUpdated": "List updated!",
29
     "listUpdateFail": "Error while updating list"
29
     "listUpdateFail": "Error while updating list"
30
   },
30
   },
31
+  "planningScreen": {
32
+    "wipTitle": "WORK IN PROGRESS",
33
+    "wipSubtitle": "Soon, every event at the INSA Toulouse in one place !"
34
+  },
31
   "aboutScreen": {
35
   "aboutScreen": {
32
     "appstore": "See on the Appstore",
36
     "appstore": "See on the Appstore",
33
     "playstore": "See on the Playstore",
37
     "playstore": "See on the Playstore",

+ 4
- 0
translations/fr.json View File

28
     "listUpdated": "List mise à jour!",
28
     "listUpdated": "List mise à jour!",
29
     "listUpdateFail": "Erreur lors de la mise à jour de la liste"
29
     "listUpdateFail": "Erreur lors de la mise à jour de la liste"
30
   },
30
   },
31
+  "planningScreen": {
32
+    "wipTitle": "WORK IN PROGRESS",
33
+    "wipSubtitle": "Bientôt, tous les évènements de l'INSA Toulouse en un seul endroit !"
34
+  },
31
   "aboutScreen": {
35
   "aboutScreen": {
32
     "appstore": "Voir sur l'Appstore",
36
     "appstore": "Voir sur l'Appstore",
33
     "playstore": "Voir sur le Playstore",
37
     "playstore": "Voir sur le Playstore",

Loading…
Cancel
Save