From a0f9b543ba20fc9c1bdc2d061086446af445232c Mon Sep 17 00:00:00 2001 From: selfisekai Date: Thu, 8 Oct 2020 00:44:02 +0200 Subject: [PATCH] styling update --- front/src/index.ts | 10 ++++++++-- front/src/style.scss | 1 + webroot/index.html | 23 +++++++++++++++++------ 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/front/src/index.ts b/front/src/index.ts index 59b2d9c..74d8c46 100644 --- a/front/src/index.ts +++ b/front/src/index.ts @@ -5,6 +5,9 @@ const request = (resource: string, data: any) => method: "POST", body: new URLSearchParams(data).toString(), credentials: "include", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, }).then((res) => res.json()); const openLockerConfirm = (lat: string, lon: string, openCode: string, id: string) => { @@ -44,7 +47,7 @@ const refreshPackages = () => const sender = row.insertCell(1); const status = row.insertCell(2); const locker = row.insertCell(3); - const openAction = row.insertCell(4); + const opener = row.insertCell(4); row.dataset.lat = shipment.pickupPoint.location.latitude.toString(); row.dataset.lon = shipment.pickupPoint.location.longitude.toString(); @@ -55,11 +58,14 @@ const refreshPackages = () => sender.innerText = shipment.senderName; status.innerText = shipment.status; locker.innerText = `${shipment.pickupPoint.name} - ${shipment.pickupPoint.description}`; + const openAction = document.createElement("a"); + openAction.classList.add("button", "is-light", "is-small"); openAction.innerHTML = "Open"; openAction.addEventListener("click", (event) => { - const data = ((event.target as Element).parentNode as HTMLElement).dataset; + const data = ((event.target as Element).parentNode!.parentNode as HTMLElement).dataset; openLocker(data.lat!, data.lon!, data.openCode!, data.id!); }); + opener.appendChild(openAction); // console.log(shipment); }); diff --git a/front/src/style.scss b/front/src/style.scss index 425973b..363c48e 100644 --- a/front/src/style.scss +++ b/front/src/style.scss @@ -1,3 +1,4 @@ +$family-sans-serif: BlinkMacSystemFont, -apple-system, sans-serif; // TODO: only import necessary styles @import "../node_modules/bulma/bulma.sass"; diff --git a/webroot/index.html b/webroot/index.html index fc74801..ad060fa 100644 --- a/webroot/index.html +++ b/webroot/index.html @@ -8,6 +8,7 @@ +
-
- Are you sure? -
Open locker
+
+
Are you sure?
+
+ +
-
- -
OK
+
+
Error
+
+ +
+ OK +
+
@@ -60,5 +70,6 @@
+