From 2b8c08e082e5933a3e86f9ce81ebb22a4764d926 Mon Sep 17 00:00:00 2001 From: williameriksson126 Date: Thu, 10 Dec 2020 11:01:43 +0100 Subject: [PATCH] Change: departureuser4 to work correctly and updated UI for disruptions --- src/APIexamples/departureuser4.json | 3 +-- src/components/DisruptionButton.js | 2 +- src/components/NavigationDrawer.js | 16 ++++++++-------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/APIexamples/departureuser4.json b/src/APIexamples/departureuser4.json index 71ce140..4b43472 100644 --- a/src/APIexamples/departureuser4.json +++ b/src/APIexamples/departureuser4.json @@ -3,7 +3,7 @@ "noNamespaceSchemaLocation": "http://api.vasttrafik.se/v1/hafasRestDepartureBoard.xsd", "servertime": "10:11", "serverdate": "2020-12-10", - "Departure": [ + "Departure": { "name": "Buss 928", "sname": "928", @@ -26,6 +26,5 @@ "ref": "https://api.vasttrafik.se/bin/rest.exe/v2/journeyDetail?ref=261732%2F87569%2F149176%2F12656%2F80%3Fdate%3D2020-12-10%26station_evaId%3D14225001%26station_type%3Ddep%26format%3Djson%26" } } - ] } } \ No newline at end of file diff --git a/src/components/DisruptionButton.js b/src/components/DisruptionButton.js index 63f0171..bbca6e2 100644 --- a/src/components/DisruptionButton.js +++ b/src/components/DisruptionButton.js @@ -16,7 +16,7 @@ class DisruptionButton extends Button { genDisrupt = () => { - this.state.disruption = "" + this.state.disruption = undefined if(this.state.jsonLocation === "ex1"){ for (let stopPoint of ex1.affectedStopPoints) { if(stopPoint.gid === globData.user.stoppointgid){ diff --git a/src/components/NavigationDrawer.js b/src/components/NavigationDrawer.js index adb42f2..46c4d48 100644 --- a/src/components/NavigationDrawer.js +++ b/src/components/NavigationDrawer.js @@ -9,7 +9,7 @@ import Button from './Button.js'; import './css/NavigationDrawer.css'; import userIcon from '../img/user.svg'; -import FindStops from './FindStops.js'; +import { glob } from 'glob'; class NavigationDrawer extends Component { @@ -44,6 +44,10 @@ class NavigationDrawer extends Component { showPopup = () => { this.popupElem.current.show(); }; + + updatePage = () => { + globalData.currentPage.render(); + } render() { return ( @@ -51,10 +55,8 @@ class NavigationDrawer extends Component {

Välj hållplats:

@@ -69,9 +71,7 @@ class NavigationDrawer extends Component { - - - +
Projektgrupp 3 - Utmaning 7