Browse Source

Added planning screen placeholder

keplyx 3 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,15 +1,27 @@
1 1
 // @flow
2 2
 
3 3
 import * as React from 'react';
4
-import {Container, Text} from 'native-base';
4
+import {Button, Container, H3, Text} from 'native-base';
5 5
 import CustomHeader from "../components/CustomHeader";
6 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 12
 type Props = {
9 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 25
  * Class defining the app's planning screen
14 26
  */
15 27
 export default class PlanningScreen extends React.Component<Props> {
@@ -18,6 +30,46 @@ export default class PlanningScreen extends React.Component<Props> {
18 30
         return (
19 31
             <Container>
20 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 73
             </Container>
22 74
         );
23 75
     }

+ 1
- 1
screens/ProxiwashScreen.js View File

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

+ 4
- 0
translations/en.json View File

@@ -28,6 +28,10 @@
28 28
     "listUpdated": "List updated!",
29 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 35
   "aboutScreen": {
32 36
     "appstore": "See on the Appstore",
33 37
     "playstore": "See on the Playstore",

+ 4
- 0
translations/fr.json View File

@@ -28,6 +28,10 @@
28 28
     "listUpdated": "List mise à jour!",
29 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 35
   "aboutScreen": {
32 36
     "appstore": "Voir sur l'Appstore",
33 37
     "playstore": "Voir sur le Playstore",

Loading…
Cancel
Save