Browse Source

Fixed crash on menu screen + added french dashboard translation

keplyx 4 years ago
parent
commit
44294bb7ca
3 changed files with 21 additions and 8 deletions
  1. 1
    1
      components/Sidebar.js
  2. 3
    6
      screens/SelfMenuScreen.js
  3. 17
    1
      translations/fr.json

+ 1
- 1
components/Sidebar.js View File

71
     }
71
     }
72
 
72
 
73
     /**
73
     /**
74
-     * Navigate to the selected route, close the drawer, and mark the correct item as selected
74
+     * Navigate to the selected route
75
      * @param route {string} The route name to navigate to
75
      * @param route {string} The route name to navigate to
76
      */
76
      */
77
     navigateToScreen(route: string) {
77
     navigateToScreen(route: string) {

+ 3
- 6
screens/SelfMenuScreen.js View File

53
     }
53
     }
54
 
54
 
55
     getKeyExtractor(item: Object) {
55
     getKeyExtractor(item: Object) {
56
-        return item !== undefined ? item['date'] + '_' + item['name'] : undefined;
56
+        return item !== undefined ? item['name'] : undefined;
57
     }
57
     }
58
 
58
 
59
     hasBackButton() {
59
     hasBackButton() {
71
             result = [
71
             result = [
72
                 {
72
                 {
73
                     title: '',
73
                     title: '',
74
-                    data: {},
74
+                    data: [],
75
                     extraData: super.state,
75
                     extraData: super.state,
76
                     keyExtractor: this.getKeyExtractor
76
                     keyExtractor: this.getKeyExtractor
77
                 }
77
                 }
79
         }
79
         }
80
         // fetched data is an array here
80
         // fetched data is an array here
81
         for (let i = 0; i < fetchedData.length; i++) {
81
         for (let i = 0; i < fetchedData.length; i++) {
82
-            // Add the date to the item to allow creation of unique list id
83
-            for (let item of fetchedData[i].meal[0].foodcategory) {
84
-                item['date'] = fetchedData[i]['date'];
85
-            }
86
             result.push(
82
             result.push(
87
                 {
83
                 {
88
                     title: this.getFormattedDate(fetchedData[i].date),
84
                     title: this.getFormattedDate(fetchedData[i].date),
109
                 marginRight: 10,
105
                 marginRight: 10,
110
                 marginTop: 10,
106
                 marginTop: 10,
111
                 marginBottom: 10,
107
                 marginBottom: 10,
108
+                borderRadius: 50
112
             }}>
109
             }}>
113
                 <H2 style={{
110
                 <H2 style={{
114
                     textAlign: 'center',
111
                     textAlign: 'center',

+ 17
- 1
translations/fr.json View File

69
   },
69
   },
70
   "homeScreen": {
70
   "homeScreen": {
71
     "listUpdated": "List mise à jour!",
71
     "listUpdated": "List mise à jour!",
72
-    "listUpdateFail": "Erreur lors de la mise à jour de la liste"
72
+    "listUpdateFail": "Erreur lors de la mise à jour de la liste",
73
+    "newsFeed": "Nouvelles du campus",
74
+    "dashboard": {
75
+      "todayEventsTitle": "Événements aujourd'hui",
76
+      "todayEventsSubtitleNA": "Pas d'événements",
77
+      "todayEventsSubtitle": " événements aujourd'hui",
78
+      "proximoTitle": "Proximo",
79
+      "proximoSubtitleNA": "pas d'article en vente",
80
+      "proximoSubtitle": " articles disponibles",
81
+      "proxiwashTitle": "Machines disponibles",
82
+      "proxiwashSubtitleNA": "Pas de machine disponible",
83
+      "proxiwashSubtitle1": " sèches linges et ",
84
+      "proxiwashSubtitle2": " laves linges",
85
+      "menuTitle": "Menu d'aujourd'hui",
86
+      "menuSubtitleNA": "Pas de menu disponible",
87
+      "menuSubtitle": "Cliquez ici pour voir le menu"
88
+    }
73
   },
89
   },
74
   "planningScreen": {
90
   "planningScreen": {
75
     "wipTitle": "WORK IN PROGRESS",
91
     "wipTitle": "WORK IN PROGRESS",

Loading…
Cancel
Save