Browse Source

Added planex webview

keplyx 2 years ago
parent
commit
a663d8256a
8 changed files with 73 additions and 15 deletions
  1. 2
    2
      app.json
  2. 6
    8
      components/SideMenu.js
  3. 2
    0
      navigation/MainDrawerNavigator.js
  4. 12
    3
      package-lock.json
  5. 1
    0
      package.json
  6. 50
    0
      screens/PlanexScreen.js
  7. 0
    1
      translations/en.json
  8. 0
    1
      translations/fr.json

+ 2
- 2
app.json View File

@@ -10,7 +10,7 @@
10 10
       "android",
11 11
       "web"
12 12
     ],
13
-    "version": "0.0.5",
13
+    "version": "0.0.6",
14 14
     "orientation": "portrait",
15 15
     "primaryColor": "#e42612",
16 16
     "icon": "./assets/icon.png",
@@ -32,7 +32,7 @@
32 32
     ],
33 33
     "ios": {
34 34
       "bundleIdentifier": "amicale.insat.application",
35
-      "buildNumber": "0.0.5",
35
+      "buildNumber": "0.0.6",
36 36
       "icon": "./assets/ios.icon.png"
37 37
     },
38 38
     "android": {

+ 6
- 8
components/SideMenu.js View File

@@ -12,7 +12,6 @@ const drawerCover = require("../assets/drawer-cover.png");
12 12
 
13 13
 const WIKETUD_LINK = "https://www.etud.insa-toulouse.fr/wiketud";
14 14
 const Amicale_LINK = "https://www.etud.insa-toulouse.fr/~amicale";
15
-const TIMETABLE_LINK = "http://planex.insa-toulouse.fr";
16 15
 
17 16
 type Props = {
18 17
     navigation: Object,
@@ -64,18 +63,17 @@ export default class SideBar extends React.Component<Props, State> {
64 63
                 icon: "shopping",
65 64
             },
66 65
             {
66
+                name: 'Planex',
67
+                route: "Planex",
68
+                icon: "timetable",
69
+            },
70
+            {
67 71
                 name: "Amicale",
68 72
                 route: "amicale",
69 73
                 icon: "web",
70 74
                 link: Amicale_LINK
71 75
             },
72 76
             {
73
-                name: i18n.t('screens.timetable'),
74
-                route: "timetable",
75
-                icon: "timetable",
76
-                link: TIMETABLE_LINK
77
-            },
78
-            {
79 77
                 name: "Wiketud",
80 78
                 route: "wiketud",
81 79
                 icon: "wikipedia",
@@ -120,7 +118,7 @@ export default class SideBar extends React.Component<Props, State> {
120 118
                         renderItem={({item}) =>
121 119
                             <ListItem
122 120
                                 button
123
-                                noBorder={item.name !== 'Wiketud' && item.name !== 'Proximo'} // Display a separator before settings and Amicale
121
+                                noBorder={item.name !== 'Wiketud' && item.name !== 'Planex'} // Display a separator before settings and Amicale
124 122
                                 selected={this.state.active === item.route}
125 123
                                 onPress={() => {
126 124
                                     if (item.link !== undefined)

+ 2
- 0
navigation/MainDrawerNavigator.js View File

@@ -7,6 +7,7 @@ import HomeScreen from '../screens/HomeScreen';
7 7
 import PlanningScreen from '../screens/PlanningScreen';
8 8
 import ProxiwashScreen from '../screens/ProxiwashScreen';
9 9
 import ProximoMainScreen from '../screens/Proximo/ProximoMainScreen';
10
+import PlanexScreen from '../screens/PlanexScreen';
10 11
 import SettingsScreen from '../screens/SettingsScreen';
11 12
 import AboutScreen from '../screens/About/AboutScreen';
12 13
 import SideMenu from "../components/SideMenu";
@@ -19,6 +20,7 @@ export default createDrawerNavigator({
19 20
         Planning: {screen: PlanningScreen,},
20 21
         Proxiwash: {screen: ProxiwashScreen,},
21 22
         Proximo: {screen: ProximoMainScreen,},
23
+        Planex: {screen: PlanexScreen},
22 24
         Settings: {screen: SettingsScreen,},
23 25
         About: {screen: AboutScreen,},
24 26
     }, {

+ 12
- 3
package-lock.json View File

@@ -2595,6 +2595,15 @@
2595 2595
           "version": "5.0.1",
2596 2596
           "resolved": "https://registry.npmjs.org/expo-linear-gradient/-/expo-linear-gradient-5.0.1.tgz",
2597 2597
           "integrity": "sha512-5dKn9JIXmXXHq6itC/Jpqo65Tkgjwacyw1kpD8sekoFTEVfT6ciFd2djqIcciUqIa57FF/5d2q54mUvjoqD/TA=="
2598
+        },
2599
+        "react-native-webview": {
2600
+          "version": "5.8.1",
2601
+          "resolved": "https://registry.npmjs.org/react-native-webview/-/react-native-webview-5.8.1.tgz",
2602
+          "integrity": "sha512-b6pSvmjoiWtcz6YspggW02X+BRXJWuquHwkh37BRx1NMW1iwMZA31SnFQvTpPzWYYIb9WF/mRsy2nGtt9C6NIg==",
2603
+          "requires": {
2604
+            "escape-string-regexp": "1.0.5",
2605
+            "invariant": "2.2.4"
2606
+          }
2598 2607
         }
2599 2608
       }
2600 2609
     },
@@ -5998,9 +6007,9 @@
5998 6007
       "integrity": "sha512-yO9vWi/11m2hEJl8FrW1SMeVzFfPtMKh20MUInGqlsL0H8Ya2JGGlFfrBzx1KiFR2hFb5OdsTLYNtcVZtJ6pLQ=="
5999 6008
     },
6000 6009
     "react-native-webview": {
6001
-      "version": "5.8.1",
6002
-      "resolved": "https://registry.npmjs.org/react-native-webview/-/react-native-webview-5.8.1.tgz",
6003
-      "integrity": "sha512-b6pSvmjoiWtcz6YspggW02X+BRXJWuquHwkh37BRx1NMW1iwMZA31SnFQvTpPzWYYIb9WF/mRsy2nGtt9C6NIg==",
6010
+      "version": "5.12.1",
6011
+      "resolved": "https://registry.npmjs.org/react-native-webview/-/react-native-webview-5.12.1.tgz",
6012
+      "integrity": "sha512-pFYzyNUG+k7Jk2a0Z3S1+OL9qtp0VQxVP08d1ume/O6l1Xibi0K0hRZms7zPUHqQc2uWEfjZ0FOa17MIN7vruw==",
6004 6013
       "requires": {
6005 6014
         "escape-string-regexp": "1.0.5",
6006 6015
         "invariant": "2.2.4"

+ 1
- 0
package.json View File

@@ -25,6 +25,7 @@
25 25
     "react-native-autolink": "^1.8.1",
26 26
     "react-native-platform-touchable": "^1.1.1",
27 27
     "react-native-status-bar-height": "^2.3.1",
28
+    "react-native-webview": "^5.8.1",
28 29
     "react-navigation": "^3.11.0"
29 30
   },
30 31
   "devDependencies": {

+ 50
- 0
screens/PlanexScreen.js View File

@@ -0,0 +1,50 @@
1
+// @flow
2
+
3
+import * as React from 'react';
4
+import {View} from 'react-native';
5
+import {Container, Content, Spinner} from 'native-base';
6
+import CustomHeader from "../components/CustomHeader";
7
+import WebView from "react-native-webview";
8
+
9
+type Props = {
10
+    navigation: Object,
11
+}
12
+
13
+type State = {
14
+    isFinishedLoading: boolean
15
+}
16
+
17
+const PLANEX_URL = 'http://planex.insa-toulouse.fr/';
18
+
19
+/**
20
+ * Class defining the app's planex screen.
21
+ * This screen uses a webview to render the planex page
22
+ */
23
+export default class PlanningScreen extends React.Component<Props, State> {
24
+
25
+    state = {
26
+        isFinishedLoading: false,
27
+    };
28
+
29
+    render() {
30
+        const nav = this.props.navigation;
31
+        return (
32
+            <Container>
33
+                <CustomHeader navigation={nav} title={'Planex'}/>
34
+                <WebView
35
+                    source={{uri: PLANEX_URL}}
36
+                    style={{width: this.state.isFinishedLoading ? '100%' : 0}}
37
+                    onLoadEnd={() => {
38
+                        this.setState({isFinishedLoading: true})
39
+                    }}
40
+                />
41
+                {this.state.isFinishedLoading ?
42
+                    <View/> :
43
+                    <Content>
44
+                        <Spinner/>
45
+                    </Content>}
46
+            </Container>
47
+        );
48
+    }
49
+}
50
+

+ 0
- 1
translations/en.json View File

@@ -4,7 +4,6 @@
4 4
     "planning": "Planning",
5 5
     "proxiwash": "Proxiwash",
6 6
     "proximo": "Proximo",
7
-    "timetable": "Timetable",
8 7
     "settings": "Settings",
9 8
     "about": "About"
10 9
   },

+ 0
- 1
translations/fr.json View File

@@ -4,7 +4,6 @@
4 4
     "planning": "Planning",
5 5
     "proxiwash": "Proxiwash",
6 6
     "proximo": "Proximo",
7
-    "timetable": "Emploi du temps",
8 7
     "settings": "Paramètres",
9 8
     "about": "À Propos"
10 9
   },

Loading…
Cancel
Save