Skip to content

Commit 3174963

Browse files
authored
Merge pull request #9 from Levis92/develop
Align departure times
2 parents 00c9eef + f0dccb3 commit 3174963

4 files changed

Lines changed: 12 additions & 20 deletions

File tree

flask-app/requirements.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

infohub/src/App.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infohub/src/components/vasttrafik/departure-item.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ moment.updateLocale("sv", {
1818
}
1919
});
2020

21-
function joinString(string1, string2) {
22-
return string1 + " " + string2;
23-
}
2421

2522
class DepartureItem extends Component {
2623
checkAccessibility(accessibility) {
@@ -35,7 +32,7 @@ class DepartureItem extends Component {
3532
default:
3633
return;
3734
}
38-
return <i className={"accessibility-icon fa fa-" + icon} />;
35+
return <i className={`accessibility-icon fa fa-${icon}`} />;
3936
}
4037

4138
checkTime(time) {
@@ -44,7 +41,7 @@ class DepartureItem extends Component {
4441
if (now.diff(time, "seconds") >= 0) {
4542
result = "Nu";
4643
}
47-
return result;
44+
return <span>{result}</span>;
4845
}
4946

5047
render() {
@@ -69,8 +66,8 @@ class DepartureItem extends Component {
6966
borderRadius: "0.2em"
7067
};
7168

72-
const now = joinString(rtDate, rtTime);
73-
const next = joinString(nextRtDate, nextRtTime);
69+
const now = [rtDate, rtTime].join(" ");
70+
const next = [nextRtDate, nextRtTime].join(" ");
7471
const time = moment(now, "YYYY-MM-DD HH:mm");
7572
const nextTime = moment(next, "YYYY-MM-DD HH:mm");
7673

infohub/src/stylesheets/partials/_vasttrafik.sass

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,7 @@
4343
border-radius: 0.2em
4444
margin-right: 0.5em
4545
font-size: 1rem
46+
i
47+
position: absolute
48+
.departs span, .next-departure span
49+
text-indent: 1.4em

0 commit comments

Comments
 (0)