+ return (
+
+
+ Karang Guni Schedule
+
+
+
+ Date
+ Time
+ Location
+ Postal Code
+ Status
+
+
+ {scheduleList.map((schedule) => (
+
+
+ {(
+ schedule.dateTime as unknown as Date
+ ).toLocaleDateString()}
+
+
+ {(schedule.dateTime as unknown as Date).toLocaleTimeString(
+ [],
+ { hour: "2-digit", minute: "2-digit" }
+ )}
+
+ {schedule.location}
+ {schedule.postalCode}
+ {schedule.status}
+
+ ))}
+
+
+
+
+
-
-
-
-
- Paper
- $0.05 to 0.20/KG
-
- - Cardboard ($0.20/kg)
- - Newspaper and B&W ($0.11/kg)
- - Mix paper ($0.05/kg)
-
-
-
-
-
-
-
- Paper
- $0.05 to 0.20/KG
-
- - Cardboard ($0.20/kg)
- - Newspaper and B&W ($0.11/kg)
- - Mix paper ($0.05/kg)
-
-
-
-
-
-
-
- Paper
- $0.05 to 0.20/KG
-
- - Cardboard ($0.20/kg)
- - Newspaper and B&W ($0.11/kg)
- - Mix paper ($0.05/kg)
-
-
-
-
-
+
+
+ Paper
+ $0.05 to 0.20/KG
+
+ - Cardboard ($0.20/kg)
+ - Newspaper and B&W ($0.11/kg)
+ - Mix paper ($0.05/kg)
+
+
+
+
+
+
+
+ Paper
+ $0.05 to 0.20/KG
+
+ - Cardboard ($0.20/kg)
+ - Newspaper and B&W ($0.11/kg)
+ - Mix paper ($0.05/kg)
+
+
+
+
+
+
+
+ Paper
+ $0.05 to 0.20/KG
+
+ - Cardboard ($0.20/kg)
+ - Newspaper and B&W ($0.11/kg)
+ - Mix paper ($0.05/kg)
+
+
+
-
-
-
- );
- }
\ No newline at end of file
+
+
+
+
+ );
+}
diff --git a/client/src/pages/SpringboardPage.tsx b/client/src/pages/SpringboardPage.tsx
index bc45935..392518e 100644
--- a/client/src/pages/SpringboardPage.tsx
+++ b/client/src/pages/SpringboardPage.tsx
@@ -1,4 +1,4 @@
-import { useNavigate, useParams } from "react-router-dom";
+import { useNavigate } from "react-router-dom";
import DefaultLayout from "../layouts/default";
import { useEffect, useState } from "react";
import { Button, Card, Link } from "@nextui-org/react";
@@ -9,13 +9,15 @@ import { retrieveUserInformation } from "../security/users";
import UserProfilePicture from "../components/UserProfilePicture";
export default function SpringboardPage() {
- let { accessToken } = useParams
(); // TODO: Replace AT from props with AT from localstorage
+ const navigate = useNavigate();
+ let accessToken = localStorage.getItem("accessToken");
+ if (!accessToken) {
+ navigate("/signin");
+ }
let [userInformation, setUserInformation] = useState();
let [accountUnavailable, setAccountUnavaliable] = useState(false);
let timeOfDay = getTimeOfDay();
- const navigate = useNavigate();
-
let greeting = "";
if (timeOfDay === 0) {
greeting = "Good morning";
@@ -26,11 +28,11 @@ export default function SpringboardPage() {
}
useEffect(() => {
- retrieveUserInformation(accessToken!)
+ retrieveUserInformation()
.then((response) => {
setUserInformation(response);
})
- .catch((error) => {
+ .catch((_) => {
setAccountUnavaliable(true);
});
return;
@@ -60,7 +62,7 @@ export default function SpringboardPage() {
}
onPress={() => {
- navigate("/manage-account/" + accessToken);
+ navigate("/manage-account/");
}}
>
Manage your account
@@ -68,7 +70,6 @@ export default function SpringboardPage() {