Compare commits
No commits in common. "main" and "we-new-users" have entirely different histories.
main
...
we-new-use
@ -10,7 +10,7 @@
|
|||||||
"journeyNumber": "22",
|
"journeyNumber": "22",
|
||||||
"type": "BUS",
|
"type": "BUS",
|
||||||
"stopid": "9022014014751002",
|
"stopid": "9022014014751002",
|
||||||
"stop": "Guddeby",
|
"stop": "Guddeby, Kungälv",
|
||||||
"time": "09:40",
|
"time": "09:40",
|
||||||
"date": "2020-12-11",
|
"date": "2020-12-11",
|
||||||
"journeyid": "9015014621000022",
|
"journeyid": "9015014621000022",
|
||||||
@ -32,7 +32,7 @@
|
|||||||
"journeyNumber": "2",
|
"journeyNumber": "2",
|
||||||
"type": "BUS",
|
"type": "BUS",
|
||||||
"stopid": "9022014014751002",
|
"stopid": "9022014014751002",
|
||||||
"stop": "Guddeby",
|
"stop": "Guddeby, Kungälv",
|
||||||
"time": "12:29",
|
"time": "12:29",
|
||||||
"date": "2020-12-11",
|
"date": "2020-12-11",
|
||||||
"journeyid": "9015014692700002",
|
"journeyid": "9015014692700002",
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
"journeyNumber": "22",
|
"journeyNumber": "22",
|
||||||
"type": "BUS",
|
"type": "BUS",
|
||||||
"stopid": "9022014014010002",
|
"stopid": "9022014014010002",
|
||||||
"stop": "Hålta kyrka",
|
"stop": "Hålta kyrka, Kungälv",
|
||||||
"time": "09:47",
|
"time": "09:47",
|
||||||
"date": "2020-12-11",
|
"date": "2020-12-11",
|
||||||
"journeyid": "9015014621000022",
|
"journeyid": "9015014621000022",
|
||||||
@ -32,7 +32,7 @@
|
|||||||
"journeyNumber": "2",
|
"journeyNumber": "2",
|
||||||
"type": "BUS",
|
"type": "BUS",
|
||||||
"stopid": "9022014014010002",
|
"stopid": "9022014014010002",
|
||||||
"stop": "Hålta kyrka",
|
"stop": "Hålta kyrka, Kungälv",
|
||||||
"time": "12:38",
|
"time": "12:38",
|
||||||
"date": "2020-12-11",
|
"date": "2020-12-11",
|
||||||
"journeyid": "9015014692700002",
|
"journeyid": "9015014692700002",
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
"journeyNumber": "22",
|
"journeyNumber": "22",
|
||||||
"type": "BUS",
|
"type": "BUS",
|
||||||
"stopid": "9022014014614002",
|
"stopid": "9022014014614002",
|
||||||
"stop": "Stenskärsvägen",
|
"stop": "Stenskärsvägen, Kungälv",
|
||||||
"time": "09:52",
|
"time": "09:52",
|
||||||
"date": "2020-12-11",
|
"date": "2020-12-11",
|
||||||
"journeyid": "9015014621000022",
|
"journeyid": "9015014621000022",
|
||||||
@ -32,7 +32,7 @@
|
|||||||
"journeyNumber": "10",
|
"journeyNumber": "10",
|
||||||
"type": "BUS",
|
"type": "BUS",
|
||||||
"stopid": "9022014014614002",
|
"stopid": "9022014014614002",
|
||||||
"stop": "Stenskärsvägen",
|
"stop": "Stenskärsvägen, Kungälv",
|
||||||
"time": "10:44",
|
"time": "10:44",
|
||||||
"date": "2020-12-11",
|
"date": "2020-12-11",
|
||||||
"journeyid": "9015014632000010",
|
"journeyid": "9015014632000010",
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
"journeyNumber": "10",
|
"journeyNumber": "10",
|
||||||
"type": "BUS",
|
"type": "BUS",
|
||||||
"stopid": "9022014014225001",
|
"stopid": "9022014014225001",
|
||||||
"stop": "Skrämmenborg",
|
"stop": "Skrämmenborg, Kungälv",
|
||||||
"time": "15:19",
|
"time": "15:19",
|
||||||
"date": "2020-12-11",
|
"date": "2020-12-11",
|
||||||
"journeyid": "9015014692800010",
|
"journeyid": "9015014692800010",
|
||||||
|
@ -4,9 +4,13 @@
|
|||||||
"title":"Nabbensbergsvägen närmast Edsvägen helt avstängd och trafiken hänvisas istället via Korsebergsvägen. Samtidigt tas den tillfälliga förbifarten bort på Edsvägen och trafiken kommer att ledas förbi den nya cirkulationsplatsen i de två västra körfälten tills arbetet på Nabbensbergsvägen är klart Hastighet: 50km/h",
|
"title":"Nabbensbergsvägen närmast Edsvägen helt avstängd och trafiken hänvisas istället via Korsebergsvägen. Samtidigt tas den tillfälliga förbifarten bort på Edsvägen och trafiken kommer att ledas förbi den nya cirkulationsplatsen i de två västra körfälten tills arbetet på Nabbensbergsvägen är klart Hastighet: 50km/h",
|
||||||
"time":"00:07",
|
"time":"00:07",
|
||||||
"affectedStopPoints":[
|
"affectedStopPoints":[
|
||||||
|
{
|
||||||
|
"gid": "9022014014010001",
|
||||||
|
"name": "Hålta kyrka, Kungälv"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"gid": "9022014014614001",
|
"gid": "9022014014614001",
|
||||||
"name": "Stenskärsvägen"
|
"name": "Stenskärsvägen, Kungälv"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -5,16 +5,8 @@
|
|||||||
"time":"00:09",
|
"time":"00:09",
|
||||||
"affectedStopPoints":[
|
"affectedStopPoints":[
|
||||||
{
|
{
|
||||||
"gid": "9022014014751001",
|
"gid": "9022014014762001",
|
||||||
"name": "Guddeby"
|
"name": "Kuröd, Kungälv"
|
||||||
},
|
|
||||||
{
|
|
||||||
"gid": "9022014014010001",
|
|
||||||
"name": "Hålta kyrka"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"gid": "9022014014614001",
|
|
||||||
"name": "Stenskärsvägen"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -5,27 +5,27 @@
|
|||||||
"serverdate": "2020-12-11",
|
"serverdate": "2020-12-11",
|
||||||
"StopLocation": [
|
"StopLocation": [
|
||||||
{
|
{
|
||||||
"name": "Guddeby",
|
"name": "Guddeby, Kungälv",
|
||||||
"id": "9022014014751001",
|
"id": "9022014014751001",
|
||||||
"lat": "57.874665",
|
"lat": "57.874665",
|
||||||
"lon": "11.903884",
|
"lon": "11.903884",
|
||||||
"track": "A"
|
"track": "A"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Guddeby",
|
"name": "Guddeby, Kungälv",
|
||||||
"id": "9021014014751000",
|
"id": "9021014014751000",
|
||||||
"lat": "57.874710",
|
"lat": "57.874710",
|
||||||
"lon": "11.903929"
|
"lon": "11.903929"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Guddeby",
|
"name": "Guddeby, Kungälv",
|
||||||
"id": "9022014014751002",
|
"id": "9022014014751002",
|
||||||
"lat": "57.874746",
|
"lat": "57.874746",
|
||||||
"lon": "11.903965",
|
"lon": "11.903965",
|
||||||
"track": "B"
|
"track": "B"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Stället",
|
"name": "Stället, Kungälv",
|
||||||
"id": "9022014014744001",
|
"id": "9022014014744001",
|
||||||
"lat": "57.869784",
|
"lat": "57.869784",
|
||||||
"lon": "11.904172",
|
"lon": "11.904172",
|
||||||
|
@ -5,27 +5,27 @@
|
|||||||
"serverdate": "2020-12-11",
|
"serverdate": "2020-12-11",
|
||||||
"StopLocation": [
|
"StopLocation": [
|
||||||
{
|
{
|
||||||
"name": "Hålta kyrka",
|
"name": "Hålta kyrka, Kungälv",
|
||||||
"id": "9022014014010001",
|
"id": "9022014014010001",
|
||||||
"lat": "57.895125",
|
"lat": "57.895125",
|
||||||
"lon": "11.827854",
|
"lon": "11.827854",
|
||||||
"track": "A"
|
"track": "A"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Hålta kyrka",
|
"name": "Hålta kyrka, Kungälv",
|
||||||
"id": "9021014014010000",
|
"id": "9021014014010000",
|
||||||
"lat": "57.895206",
|
"lat": "57.895206",
|
||||||
"lon": "11.827647"
|
"lon": "11.827647"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Hålta kyrka",
|
"name": "Hålta kyrka, Kungälv",
|
||||||
"id": "9022014014010002",
|
"id": "9022014014010002",
|
||||||
"lat": "57.895278",
|
"lat": "57.895278",
|
||||||
"lon": "11.827440",
|
"lon": "11.827440",
|
||||||
"track": "B"
|
"track": "B"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Hålta skola",
|
"name": "Hålta skola, Kungälv",
|
||||||
"id": "9022014014015001",
|
"id": "9022014014015001",
|
||||||
"lat": "57.896015",
|
"lat": "57.896015",
|
||||||
"lon": "11.824555",
|
"lon": "11.824555",
|
||||||
|
@ -5,27 +5,27 @@
|
|||||||
"serverdate": "2020-12-11",
|
"serverdate": "2020-12-11",
|
||||||
"StopLocation": [
|
"StopLocation": [
|
||||||
{
|
{
|
||||||
"name": "Stenskärsvägen",
|
"name": "Stenskärsvägen, Kungälv",
|
||||||
"id": "9022014014614001",
|
"id": "9022014014614001",
|
||||||
"lat": "57.894594",
|
"lat": "57.894594",
|
||||||
"lon": "11.740128",
|
"lon": "11.740128",
|
||||||
"track": "A"
|
"track": "A"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Stenskärsvägen",
|
"name": "Stenskärsvägen, Kungälv",
|
||||||
"id": "9022014014614002",
|
"id": "9022014014614002",
|
||||||
"lat": "57.894729",
|
"lat": "57.894729",
|
||||||
"lon": "11.739984",
|
"lon": "11.739984",
|
||||||
"track": "B"
|
"track": "B"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Stenskärsvägen",
|
"name": "Stenskärsvägen, Kungälv",
|
||||||
"id": "9021014014614000",
|
"id": "9021014014614000",
|
||||||
"lat": "57.894738",
|
"lat": "57.894738",
|
||||||
"lon": "11.739858"
|
"lon": "11.739858"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Tjuvkilsboden",
|
"name": "Tjuvkilsboden, Kungälv",
|
||||||
"id": "9022014014615002",
|
"id": "9022014014615002",
|
||||||
"lat": "57.892743",
|
"lat": "57.892743",
|
||||||
"lon": "11.743490",
|
"lon": "11.743490",
|
||||||
|
@ -5,27 +5,27 @@
|
|||||||
"serverdate": "2020-12-11",
|
"serverdate": "2020-12-11",
|
||||||
"StopLocation": [
|
"StopLocation": [
|
||||||
{
|
{
|
||||||
"name": "Kuröd",
|
"name": "Kuröd, Kungälv",
|
||||||
"id": "9022014014762001",
|
"id": "9022014014762001",
|
||||||
"lat": "57.856687",
|
"lat": "57.856687",
|
||||||
"lon": "11.864727",
|
"lon": "11.864727",
|
||||||
"track": "A"
|
"track": "A"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Kuröd",
|
"name": "Kuröd, Kungälv",
|
||||||
"id": "9021014014762000",
|
"id": "9021014014762000",
|
||||||
"lat": "57.856831",
|
"lat": "57.856831",
|
||||||
"lon": "11.864260"
|
"lon": "11.864260"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Kuröd",
|
"name": "Kuröd, Kungälv",
|
||||||
"id": "9022014014762002",
|
"id": "9022014014762002",
|
||||||
"lat": "57.856966",
|
"lat": "57.856966",
|
||||||
"lon": "11.863774",
|
"lon": "11.863774",
|
||||||
"track": "B"
|
"track": "B"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Skrämmenborg",
|
"name": "Skrämmenborg, Kungälv",
|
||||||
"id": "9021014014225000",
|
"id": "9021014014225000",
|
||||||
"lat": "57.863528",
|
"lat": "57.863528",
|
||||||
"lon": "11.867406"
|
"lon": "11.867406"
|
||||||
|
72
src/App.js
72
src/App.js
@ -2,12 +2,12 @@ import "./variables.css";
|
|||||||
import "./App.css";
|
import "./App.css";
|
||||||
|
|
||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
|
import { BrowserRouter as Router, Route } from "react-router-dom";
|
||||||
import Snackbar from "@material-ui/core/Snackbar";
|
|
||||||
import IconButton from "@material-ui/core/IconButton";
|
|
||||||
|
|
||||||
import globalData from './GlobalData.js';
|
|
||||||
import BottomMenu from "./components/BottomMenu.js";
|
import BottomMenu from "./components/BottomMenu.js";
|
||||||
|
import NearbyStation from "./components/NearbyStation.js";
|
||||||
|
import Disruption from "./components/Disruption.js";
|
||||||
|
import StationDisruption from "./components/StationDisruption.js";
|
||||||
|
|
||||||
import Tickets from "./components/pages/Tickets.js";
|
import Tickets from "./components/pages/Tickets.js";
|
||||||
import TicketsBuy from "./components/pages/TicketsBuy.js";
|
import TicketsBuy from "./components/pages/TicketsBuy.js";
|
||||||
@ -15,61 +15,23 @@ import Travel from "./components/pages/Travel.js";
|
|||||||
import TrafficInfo from "./components/pages/TrafficInfo.js";
|
import TrafficInfo from "./components/pages/TrafficInfo.js";
|
||||||
|
|
||||||
import "./variables.css";
|
import "./variables.css";
|
||||||
import warningIcon from './img/warning.svg';
|
|
||||||
import closeIcon from './img/close.svg';
|
|
||||||
|
|
||||||
|
|
||||||
class App extends Component {
|
class App extends Component {
|
||||||
currentPageName = () => {
|
render() {
|
||||||
if (globalData.currentPage.constructor !== undefined)
|
return (
|
||||||
return globalData.currentPage.constructor.name;
|
<Router>
|
||||||
else
|
<div className="App">
|
||||||
return "";
|
<Route path="/" exact component={TicketsBuy} />
|
||||||
};
|
<Route path="/tickets" exact component={Tickets} />
|
||||||
|
<Route path="/ticketsBuy" exact component={TicketsBuy} />
|
||||||
render() {
|
<Route path="/travel" exact component={Travel} />
|
||||||
globalData.root = this;
|
<Route path="/traffic" exact component={TrafficInfo} />
|
||||||
|
|
||||||
return (
|
<BottomMenu />
|
||||||
<Router>
|
</div>
|
||||||
<div className="App">
|
</Router>
|
||||||
<Route path="/" exact component={TicketsBuy} />
|
|
||||||
<Route path="/tickets" exact component={Tickets} />
|
|
||||||
<Route path="/ticketsBuy" exact component={TicketsBuy} />
|
|
||||||
<Route path="/travel" exact component={Travel} />
|
|
||||||
<Route path="/traffic" exact component={TrafficInfo} />
|
|
||||||
|
|
||||||
<BottomMenu />
|
|
||||||
|
|
||||||
<Snackbar
|
|
||||||
anchorOrigin={{ vertical: "bottom", horizontal: "center" }}
|
|
||||||
open={globalData.snackbarVisible}
|
|
||||||
autoHideDuration={3000}
|
|
||||||
onClose={() => globalData.snackbarVisible = false}
|
|
||||||
message={
|
|
||||||
<div id="snackDisruptInfo">
|
|
||||||
<img src={warningIcon} alt="" />
|
|
||||||
<span id="message-id">Trafikstörning upptäckt</span>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
action={[
|
|
||||||
<IconButton
|
|
||||||
key="close"
|
|
||||||
aria-label="Close"
|
|
||||||
color="inherit"
|
|
||||||
onClick={() => { globalData.snackbarVisible = false; globalData.root.forceUpdate() }}
|
|
||||||
>
|
|
||||||
{this.currentPageName() !== "TrafficInfo" &&
|
|
||||||
<Link to="/traffic">Visa trafikinfo</Link>
|
|
||||||
}
|
|
||||||
<img src={closeIcon} alt="" />
|
|
||||||
</IconButton>,
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</Router>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default App;
|
export default App;
|
||||||
|
@ -14,8 +14,7 @@ let globalData = {
|
|||||||
disruption: new Disruption(
|
disruption: new Disruption(
|
||||||
),
|
),
|
||||||
stop: new Stop(
|
stop: new Stop(
|
||||||
),
|
)
|
||||||
currentPage: ""
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default globalData;
|
export default globalData;
|
@ -23,104 +23,97 @@ import ex2 from '../APIexamples/disruption2.json'
|
|||||||
|
|
||||||
|
|
||||||
class DisruptionButton extends Button {
|
class DisruptionButton extends Button {
|
||||||
constructor(props) {
|
state = {
|
||||||
super(props);
|
jsonLocation: this.props.path,
|
||||||
this.state = {
|
disruption: "",
|
||||||
jsonLocation: this.props.path,
|
u1 : user1,
|
||||||
disruption: "",
|
u2 : user2,
|
||||||
u1: user1,
|
u3 : user3,
|
||||||
u2: user2,
|
u4 : user4,
|
||||||
u3: user3,
|
}
|
||||||
u4: user4,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
updatePage = () => {
|
updatePage = () => {
|
||||||
globalData.currentPage.forceUpdate();
|
globalData.currentPage.forceUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showMomentTime = (time) => {
|
||||||
|
return(time.format("HH:mm"))
|
||||||
|
}
|
||||||
|
|
||||||
showMomentTime = (time) => {
|
genUsers = () => {
|
||||||
return (time.format("HH:mm"))
|
if(globalData.users.length < 2){
|
||||||
}
|
this.state.first = true;
|
||||||
|
this.state.u1.stop = locationuser1.LocationList.StopLocation[0];
|
||||||
|
this.state.u1.stop.departures = departureuser1.DepartureBoard.Departures;
|
||||||
|
this.state.u2.stop = locationuser2.LocationList.StopLocation[0];
|
||||||
|
this.state.u2.stop.departures = departureuser2.DepartureBoard.Departures;
|
||||||
|
this.state.u3.stop = locationuser3.LocationList.StopLocation[0];
|
||||||
|
this.state.u3.stop.departures = departureuser3.DepartureBoard.Departures;
|
||||||
|
this.state.u4.stop = locationuser4.LocationList.StopLocation[0];
|
||||||
|
this.state.u4.stop.departures = departureuser4.DepartureBoard.Departures;
|
||||||
|
globalData.users = [
|
||||||
|
this.state.u1,
|
||||||
|
this.state.u2,
|
||||||
|
this.state.u3,
|
||||||
|
this.state.u4
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
genUsers = () => {
|
genDisrupt = () => {
|
||||||
if (globalData.users.length < 2) {
|
this.genUsers()
|
||||||
this.state.first = true;
|
|
||||||
this.state.u1.stop = locationuser1.LocationList.StopLocation[0];
|
|
||||||
this.state.u1.stop.departures = departureuser1.DepartureBoard.Departures;
|
|
||||||
this.state.u2.stop = locationuser2.LocationList.StopLocation[0];
|
|
||||||
this.state.u2.stop.departures = departureuser2.DepartureBoard.Departures;
|
|
||||||
this.state.u3.stop = locationuser3.LocationList.StopLocation[0];
|
|
||||||
this.state.u3.stop.departures = departureuser3.DepartureBoard.Departures;
|
|
||||||
this.state.u4.stop = locationuser4.LocationList.StopLocation[0];
|
|
||||||
this.state.u4.stop.departures = departureuser4.DepartureBoard.Departures;
|
|
||||||
globalData.users = [
|
|
||||||
this.state.u1,
|
|
||||||
this.state.u2,
|
|
||||||
this.state.u3,
|
|
||||||
this.state.u4
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
genDisrupt = () => {
|
this.state.disruption = undefined
|
||||||
this.genUsers()
|
if(this.state.jsonLocation === "ex1"){
|
||||||
|
for (let stopPoint of ex1.affectedStopPoints) {
|
||||||
|
for (let user of globalData.users){
|
||||||
|
if(stopPoint.gid === user.stoppointgid){
|
||||||
|
this.state.disruption = ex1;
|
||||||
|
var old1t = moment(user.stop.departures[0].time,"HH:mm");
|
||||||
|
old1t.add(ex1.time, "HH:mm");
|
||||||
|
user.stop.departures[0].newTime = this.showMomentTime(old1t);
|
||||||
|
user.stop.departures[0].trafficInfo = ex1.title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(stopPoint.gid === globalData.user.stoppointgid){
|
||||||
|
this.state.disruption = ex1;
|
||||||
|
var old2t = moment(globalData.stop.departures[0].time,"HH:mm");
|
||||||
|
old2t.add(ex1.time, "HH:mm");
|
||||||
|
globalData.stop.departures[0].newTime = this.showMomentTime(old2t);
|
||||||
|
globalData.stop.departures[0].trafficInfo = ex1.title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (this.state.jsonLocation === "ex2"){
|
||||||
|
for (let stopPoint of ex2.affectedStopPoints) {
|
||||||
|
for (let user of globalData.users){
|
||||||
|
if(stopPoint.gid === user.stoppointgid){
|
||||||
|
this.state.disruption = ex2;
|
||||||
|
var old3t = moment(user.stop.departures[0].time,"HH:mm");
|
||||||
|
old3t.add(ex2.time, "HH:mm");
|
||||||
|
user.stop.departures[0].newTime = this.showMomentTime(old3t);
|
||||||
|
user.stop.departures[0].trafficInfo = ex2.title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(stopPoint.gid === globalData.user.stoppointgid){
|
||||||
|
this.state.disruption = ex2;
|
||||||
|
var old4t = moment(globalData.stop.departures[0].time,"HH:mm");
|
||||||
|
old4t.add(ex2.time, "HH:mm");
|
||||||
|
globalData.stop.departures[0].newTime = this.showMomentTime(old4t);
|
||||||
|
globalData.stop.departures[0].trafficInfo = ex2.title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.state.disruption = undefined
|
globalData.disruption = this.state.disruption
|
||||||
if (this.state.jsonLocation === "ex1") {
|
}
|
||||||
for (let stopPoint of ex1.affectedStopPoints) {
|
|
||||||
for (let user of globalData.users) {
|
|
||||||
if (stopPoint.gid === user.stoppointgid) {
|
|
||||||
this.state.disruption = ex1;
|
|
||||||
var old1t = moment(user.stop.departures[0].time, "HH:mm");
|
|
||||||
old1t.add(ex1.time, "HH:mm");
|
|
||||||
user.stop.departures[0].newTime = this.showMomentTime(old1t);
|
|
||||||
user.stop.departures[0].trafficInfo = ex1.title;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (stopPoint.gid === globalData.user.stoppointgid) {
|
|
||||||
this.state.disruption = ex1;
|
|
||||||
var old2t = moment(globalData.stop.departures[0].time, "HH:mm");
|
|
||||||
old2t.add(ex1.time, "HH:mm");
|
|
||||||
globalData.stop.departures[0].newTime = this.showMomentTime(old2t);
|
|
||||||
globalData.stop.departures[0].trafficInfo = ex1.title;
|
|
||||||
globalData.snackbarVisible = true; globalData.root.forceUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (this.state.jsonLocation === "ex2") {
|
|
||||||
for (let stopPoint of ex2.affectedStopPoints) {
|
|
||||||
for (let user of globalData.users) {
|
|
||||||
if (stopPoint.gid === user.stoppointgid) {
|
|
||||||
this.state.disruption = ex2;
|
|
||||||
var old3t = moment(user.stop.departures[0].time, "HH:mm");
|
|
||||||
old3t.add(ex2.time, "HH:mm");
|
|
||||||
user.stop.departures[0].newTime = this.showMomentTime(old3t);
|
|
||||||
user.stop.departures[0].trafficInfo = ex2.title;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (stopPoint.gid === globalData.user.stoppointgid) {
|
|
||||||
this.state.disruption = ex2;
|
|
||||||
var old4t = moment(globalData.stop.departures[0].time, "HH:mm");
|
|
||||||
old4t.add(ex2.time, "HH:mm");
|
|
||||||
globalData.stop.departures[0].newTime = this.showMomentTime(old4t);
|
|
||||||
globalData.stop.departures[0].trafficInfo = ex2.title;
|
|
||||||
globalData.snackbarVisible = true; globalData.root.forceUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
globalData.disruption = this.state.disruption
|
render() {
|
||||||
}
|
return (
|
||||||
|
<Button onClick={this.props.onClick.concat([this.genDisrupt,this.updatePage])} className="disruptBtn">
|
||||||
render() {
|
{this.props.children}
|
||||||
return (
|
</Button>
|
||||||
<div>
|
);
|
||||||
<Button onClick={this.props.onClick.concat([this.genDisrupt, this.updatePage])} className="disruptBtn">
|
}
|
||||||
{this.props.children}
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,10 +71,10 @@ class NavigationDrawer extends Component {
|
|||||||
<span>example@gmail.com</span>
|
<span>example@gmail.com</span>
|
||||||
</header>
|
</header>
|
||||||
<div id="navList">
|
<div id="navList">
|
||||||
<SelectUserButton path={"user1"} username="Guddeby"/>
|
<SelectUserButton path={"user1"} username="Användare 1"/>
|
||||||
<SelectUserButton path={"user2"} username="Hålta kyrka"/>
|
<SelectUserButton path={"user2"} username="Användare 2"/>
|
||||||
<SelectUserButton path={"user3"} username="Stenskärsvägen"/>
|
<SelectUserButton path={"user3"} username="Användare 3"/>
|
||||||
<SelectUserButton path={"user4"} username="Kuröd"/>
|
<SelectUserButton path={"user4"} username="Användare 4"/>
|
||||||
<Button onClick={[this.showPopup, this.close]} className="disruptBtn"><img src={disruptIcon} alt="" />Generera Störning</Button>
|
<Button onClick={[this.showPopup, this.close]} className="disruptBtn"><img src={disruptIcon} alt="" />Generera Störning</Button>
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
|
@ -59,10 +59,7 @@ class TrafficEntry extends Component {
|
|||||||
</div>
|
</div>
|
||||||
{lineInterference &&
|
{lineInterference &&
|
||||||
<div className="infoWrapper" onClick={this.toggle}>
|
<div className="infoWrapper" onClick={this.toggle}>
|
||||||
<p className={`${this.state.expanded ? "expanded" : ""}`}>
|
<p className={`${this.state.expanded ? "expanded" : ""}`}>{trafficInfo}</p>
|
||||||
{trafficInfo}
|
|
||||||
<span style={{display: (this.state.expanded ? "inline" : "none"), marginLeft: "5px" }}><u>Visa mindre</u></span>
|
|
||||||
</p>
|
|
||||||
<span style={{display: (this.state.expanded ? "none" : "block") }}><u>Visa mer</u></span>
|
<span style={{display: (this.state.expanded ? "none" : "block") }}><u>Visa mer</u></span>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#stopTitle h1 {
|
#stopTitle h1 {
|
||||||
font-size: 3.5vh;
|
font-size: 9vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
#stopTitle h3 {
|
#stopTitle h3 {
|
||||||
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
@media screen and (min-width: 400px) {
|
@media screen and (min-width: 400px) {
|
||||||
#stopTitle h1 {
|
#stopTitle h1 {
|
||||||
font-size: 4vh;
|
font-size: 35px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#stopTitle h3 {
|
#stopTitle h3 {
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
width: 90%;
|
width: 90%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: flex-start;
|
justify-content: space-evenly;
|
||||||
margin-bottom: 2vh;
|
margin-bottom: 2vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
.trafficEntry div p {
|
.trafficEntry div p {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding: 2vh 0 0 0;
|
padding: 3vh 0 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.trafficEntry div div {
|
.trafficEntry div div {
|
||||||
@ -50,17 +50,13 @@
|
|||||||
.trafficEntry div div div {
|
.trafficEntry div div div {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-around;
|
justify-content: flex-start;
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
.timeColumn div:first-child, .lineColumn div:first-child {
|
|
||||||
height: 5.5vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.timeColumn {
|
.timeColumn {
|
||||||
flex-basis: 20%;
|
flex-basis: 15%;
|
||||||
justify-content: flex-start !important;
|
justify-content: space-between !important;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,8 +78,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.lineColumn img {
|
.lineColumn img {
|
||||||
flex-basis: 25%;
|
width: 7.5vw;
|
||||||
height: 9vw;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.infoWrapper p {
|
.infoWrapper p {
|
||||||
@ -110,20 +106,12 @@
|
|||||||
color: white;
|
color: white;
|
||||||
font-size: 6vw;
|
font-size: 6vw;
|
||||||
font-weight: 100;
|
font-weight: 100;
|
||||||
padding: 1vw 2.5vw;
|
margin-right: 10px;
|
||||||
border-radius: var(--borderRadius);
|
padding: 1vw 4vw;
|
||||||
font-family: 'Roboto Light';
|
|
||||||
height: 7vw;
|
|
||||||
flex-basis: 35%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.destination {
|
.destination {
|
||||||
flex-basis: 40%;
|
|
||||||
height: 9vw;
|
|
||||||
font-size: 4vw;
|
|
||||||
text-align: left;
|
text-align: left;
|
||||||
display: flex;
|
|
||||||
align-items: flex-end;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.trafficEntry a {
|
.trafficEntry a {
|
||||||
@ -135,5 +123,4 @@
|
|||||||
border-radius: var(--borderRadius);
|
border-radius: var(--borderRadius);
|
||||||
box-shadow: var(--boxShadow);
|
box-shadow: var(--boxShadow);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
border: 1px solid rgba(0, 0, 0, 0.2);
|
|
||||||
}
|
}
|
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Generator: Adobe Illustrator 24.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
||||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
||||||
viewBox="0 0 329 329" style="enable-background:new 0 0 329 329;" xml:space="preserve">
|
|
||||||
<path d="M194.6,164.8L322.7,36.7c8.3-8.3,8.3-21.8,0-30.1s-21.8-8.3-30.1,0l-128.1,128L36.4,6.5c-8.3-8.3-21.8-8.3-30.1,0
|
|
||||||
s-8.3,21.8,0,30.1l128.1,128.1L6.3,292.9c-8.3,8.3-8.3,21.8,0,30.1c4.2,4.2,9.6,6.2,15.1,6.2s10.9-2.1,15.1-6.2l128.1-128.1
|
|
||||||
l128,128.1c4.2,4.2,9.6,6.2,15.1,6.2s10.9-2.1,15.1-6.2c8.3-8.3,8.3-21.8,0-30.1L194.6,164.8z"/>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 691 B |
@ -32,77 +32,4 @@ button {
|
|||||||
.hidden {
|
.hidden {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
|
||||||
|
|
||||||
.MuiSnackbar-root {
|
|
||||||
width: 90%;
|
|
||||||
left: 50% !important;
|
|
||||||
bottom: 90px !important;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.MuiSnackbarContent-root {
|
|
||||||
background: white !important;
|
|
||||||
color: black !important;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 3.5vw 4vw !important;
|
|
||||||
border: 1px solid rgba(0, 0, 0, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.MuiSnackbarContent-action {
|
|
||||||
flex-basis: 38%;
|
|
||||||
justify-content: flex-end;
|
|
||||||
margin-left: 0 !important;
|
|
||||||
margin-right: 0 !important;
|
|
||||||
padding-left: 0 !important;
|
|
||||||
height: 7.5vw;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.MuiButtonBase-root{
|
|
||||||
width: 100%;
|
|
||||||
padding: 0 !important;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
.MuiButtonBase-root:active {
|
|
||||||
background: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.MuiTouchRipple-root {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.MuiSnackbarContent-message {
|
|
||||||
flex-basis: 60%;
|
|
||||||
padding: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.MuiIconButton-label {
|
|
||||||
justify-content: flex-end !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.MuiIconButton-label a {
|
|
||||||
align-items: center;
|
|
||||||
font-size: 3.5vw;
|
|
||||||
color: black;
|
|
||||||
text-decoration: none;
|
|
||||||
margin-right: 5vw;
|
|
||||||
}
|
|
||||||
|
|
||||||
.MuiIconButton-label img {
|
|
||||||
height: 3.5vw;
|
|
||||||
}
|
|
||||||
|
|
||||||
#snackDisruptInfo {
|
|
||||||
display: flex;
|
|
||||||
height: 7.5vw;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 3.5vw;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
#snackDisruptInfo img {
|
|
||||||
height: 100%;
|
|
||||||
margin-right: 15px;
|
|
||||||
}
|
}
|
@ -5,8 +5,10 @@ import App from './App';
|
|||||||
import reportWebVitals from './reportWebVitals';
|
import reportWebVitals from './reportWebVitals';
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<App />,
|
<React.StrictMode>
|
||||||
document.getElementById('root')
|
<App />
|
||||||
|
</React.StrictMode>,
|
||||||
|
document.getElementById('root')
|
||||||
);
|
);
|
||||||
|
|
||||||
// If you want to start measuring performance in your app, pass a function
|
// If you want to start measuring performance in your app, pass a function
|
||||||
|
Loading…
Reference in New Issue
Block a user