Browse Source

Updated home screen to use v2 dashboard

Arnaud Vergnet 3 years ago
parent
commit
01e3d96ddb
1 changed files with 7 additions and 9 deletions
  1. 7
    9
      src/screens/Home/HomeScreen.js

+ 7
- 9
src/screens/Home/HomeScreen.js View File

@@ -27,7 +27,7 @@ import AvailableWebsites from "../../constants/AvailableWebsites";
27 27
 
28 28
 
29 29
 const NAME_AMICALE = 'Amicale INSA Toulouse';
30
-const DATA_URL = "https://etud.insa-toulouse.fr/~amicale_app/dashboard/dashboard_data.json";
30
+const DATA_URL = "https://etud.insa-toulouse.fr/~amicale_app/v2/dashboard/dashboard_data.json";
31 31
 const FEED_ITEM_HEIGHT = 500;
32 32
 
33 33
 const SECTIONS_ID = [
@@ -55,10 +55,8 @@ export type feedItem = {
55 55
 type fullDashboard = {
56 56
     today_menu: Array<{ [key: string]: any }>,
57 57
     proximo_articles: number,
58
-    available_machines: {
59
-        dryers: number,
60
-        washers: number,
61
-    },
58
+    available_dryers: number,
59
+    available_washers: number,
62 60
     today_events: Array<{ [key: string]: any }>,
63 61
     available_tutorials: number,
64 62
 }
@@ -269,19 +267,19 @@ class HomeScreen extends React.Component<Props, State> {
269 267
                 content: [
270 268
                     {
271 269
                         id: 'washers',
272
-                        data: dashboardData == null ? 0 : dashboardData.available_machines.washers,
270
+                        data: dashboardData == null ? 0 : dashboardData.available_washers,
273 271
                         icon: 'washing-machine',
274 272
                         color: this.props.theme.colors.proxiwashColor,
275 273
                         onPress: this.onProxiwashClick,
276
-                        isAvailable: dashboardData == null ? false : dashboardData.available_machines.washers > 0
274
+                        isAvailable: dashboardData == null ? false : dashboardData.available_washers > 0
277 275
                     },
278 276
                     {
279 277
                         id: 'dryers',
280
-                        data: dashboardData == null ? 0 : dashboardData.available_machines.dryers,
278
+                        data: dashboardData == null ? 0 : dashboardData.available_dryers,
281 279
                         icon: 'tumble-dryer',
282 280
                         color: this.props.theme.colors.proxiwashColor,
283 281
                         onPress: this.onProxiwashClick,
284
-                        isAvailable: dashboardData == null ? false : dashboardData.available_machines.dryers > 0
282
+                        isAvailable: dashboardData == null ? false : dashboardData.available_dryers > 0
285 283
                     },
286 284
                     {
287 285
                         id: 'available_tutorials',

Loading…
Cancel
Save