Browse Source

Fixed crash on menu screen + added french dashboard translation

keplyx 2 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,7 +71,7 @@ export default class SideBar extends React.Component<Props, State> {
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 75
      * @param route {string} The route name to navigate to
76 76
      */
77 77
     navigateToScreen(route: string) {

+ 3
- 6
screens/SelfMenuScreen.js View File

@@ -53,7 +53,7 @@ export default class SelfMenuScreen extends FetchedDataSectionList {
53 53
     }
54 54
 
55 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 59
     hasBackButton() {
@@ -71,7 +71,7 @@ export default class SelfMenuScreen extends FetchedDataSectionList {
71 71
             result = [
72 72
                 {
73 73
                     title: '',
74
-                    data: {},
74
+                    data: [],
75 75
                     extraData: super.state,
76 76
                     keyExtractor: this.getKeyExtractor
77 77
                 }
@@ -79,10 +79,6 @@ export default class SelfMenuScreen extends FetchedDataSectionList {
79 79
         }
80 80
         // fetched data is an array here
81 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 82
             result.push(
87 83
                 {
88 84
                     title: this.getFormattedDate(fetchedData[i].date),
@@ -109,6 +105,7 @@ export default class SelfMenuScreen extends FetchedDataSectionList {
109 105
                 marginRight: 10,
110 106
                 marginTop: 10,
111 107
                 marginBottom: 10,
108
+                borderRadius: 50
112 109
             }}>
113 110
                 <H2 style={{
114 111
                     textAlign: 'center',

+ 17
- 1
translations/fr.json View File

@@ -69,7 +69,23 @@
69 69
   },
70 70
   "homeScreen": {
71 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 90
   "planningScreen": {
75 91
     "wipTitle": "WORK IN PROGRESS",

Loading…
Cancel
Save