{(timetable && timetable.slice(0, 2).map((x, i) => {
const isSoon = (x.startDate > currentTime && new Date(x.startDate) <= new Date(currentTime.getTime() + 30 * 60 * 1000))
diff --git a/rogue-thi-app/lib/backend-utils/mobility-utils.jsx b/rogue-thi-app/lib/backend-utils/mobility-utils.jsx
index f39c31fa..acb5b2ca 100644
--- a/rogue-thi-app/lib/backend-utils/mobility-utils.jsx
+++ b/rogue-thi-app/lib/backend-utils/mobility-utils.jsx
@@ -2,6 +2,8 @@ import { faEuroSign, faKey } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faCreativeCommonsNcEu } from '@fortawesome/free-brands-svg-icons'
+import { TextBlock } from 'react-placeholder/lib/placeholders'
+
import { formatFriendlyTime, formatRelativeMinutes } from '../date-utils'
import API from '../backend/authenticated-api'
import NeulandAPI from '../backend/neuland-api'
@@ -108,6 +110,29 @@ export async function getMobilityEntries (kind, station) {
}
}
+export function RenderMobilityEntryPlaceholder ({ kind, styles }) {
+ if (kind === 'charging') {
+ return (
+ <>
+
+
+
+ >
+ )
+ }
+
+ return (
+ <>
+
+ - - -
+
+
+
+
+ >
+ )
+}
+
/**
* Renders a row on the mobility page.
* @param {string} kind Mobility type (`bus`, `train`, `parking` or `charging`)
@@ -138,17 +163,17 @@ export function RenderMobilityEntry ({ kind, item, maxLen, styles, detailed }) {
const timeString = formatTimes(item.actualTime, 30, 90)
return (
- <>
-
- {item.name}
-
-
- {item.destination.length <= maxLen ? item.destination : item.destination.substr(0, maxLen) + '…'}
-
-
- {timeString}
-
- >
+ <>
+
+ {item.name}
+
+
+ {item.destination.length <= maxLen ? item.destination : item.destination.substr(0, maxLen) + '…'}
+
+
+ {timeString}
+
+ >
)
} else if (kind === 'parking') {
return (
diff --git a/rogue-thi-app/package-lock.json b/rogue-thi-app/package-lock.json
index 9d9e23fe..0cbf53ee 100644
--- a/rogue-thi-app/package-lock.json
+++ b/rogue-thi-app/package-lock.json
@@ -1263,9 +1263,9 @@
}
},
"node_modules/caniuse-lite": {
- "version": "1.0.30001446",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001446.tgz",
- "integrity": "sha512-fEoga4PrImGcwUUGEol/PoFCSBnSkA9drgdkxXkJLsUBOnJ8rs3zDv6ApqYXGQFOyMPsjh79naWhF4DAxbF8rw==",
+ "version": "1.0.30001543",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001543.tgz",
+ "integrity": "sha512-qxdO8KPWPQ+Zk6bvNpPeQIOH47qZSYdFZd6dXQzb2KzhnSXju4Kd7H1PkSJx6NICSMgo/IhRZRhhfPTHYpJUCA==",
"funding": [
{
"type": "opencollective",
@@ -1274,6 +1274,10 @@
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/caniuse-lite"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
}
]
},
diff --git a/rogue-thi-app/pages/personal.jsx b/rogue-thi-app/pages/personal.jsx
index 60df10a6..3667fe0d 100644
--- a/rogue-thi-app/pages/personal.jsx
+++ b/rogue-thi-app/pages/personal.jsx
@@ -37,6 +37,7 @@ import themes from '../data/themes.json'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
import { useTranslation } from 'next-i18next'
+import { TextBlock } from 'react-placeholder/lib/placeholders'
const PRIVACY_URL = process.env.NEXT_PUBLIC_PRIVACY_URL
@@ -121,11 +122,25 @@ export default function Personal () {
}
}, [router, userKind])
+ const placeholder = (
+ <>
+
+
+
+
+
+
+
+
+
+ >
+ )
+
return (
-
+
{userKind === USER_STUDENT &&
diff --git a/rogue-thi-app/styles/Home.module.css b/rogue-thi-app/styles/Home.module.css
index 7ec027d9..f84074b0 100644
--- a/rogue-thi-app/styles/Home.module.css
+++ b/rogue-thi-app/styles/Home.module.css
@@ -98,3 +98,15 @@
white-space: nowrap;
width: auto;
}
+
+.placeholder_2_5 {
+ margin: 2.5px 0;
+}
+
+.placeholder_3_0 {
+ margin: 3px 0;
+}
+
+.placeholder_4_0 {
+ margin: 4px 0;
+}
diff --git a/rogue-thi-app/styles/Personal.module.css b/rogue-thi-app/styles/Personal.module.css
index 0559db34..356e8fe2 100644
--- a/rogue-thi-app/styles/Personal.module.css
+++ b/rogue-thi-app/styles/Personal.module.css
@@ -33,3 +33,7 @@
justify-content: center;
align-items: center;
}
+
+.placeholder {
+ margin: 3.5px 0;
+}