From be7fb08a728422068a32b199f5952057df3a8ee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauritz=20Skog=C3=B8y?= Date: Sat, 2 Nov 2024 10:21:01 +0100 Subject: [PATCH] Debug: added logos to footer and did a quick update on the adminpage. Small changes. --- frontend/src/components/admin/booking.tsx | 122 ++++++++++++---------- frontend/src/components/footer/footer.tsx | 35 ++++++- 2 files changed, 100 insertions(+), 57 deletions(-) diff --git a/frontend/src/components/admin/booking.tsx b/frontend/src/components/admin/booking.tsx index c3ee120..538ed8b 100644 --- a/frontend/src/components/admin/booking.tsx +++ b/frontend/src/components/admin/booking.tsx @@ -171,68 +171,80 @@ const BookingComponent = () => { {bookings.length > 0 ? ( - bookings.map((item: Booking) => ( -
-
{userIdToNameMap[item.userID]}
-
- {item.item === "ONE_SOUNDBOX" ? ( -

1 soundbox

- ) : ( -

2 soundbox

- )} -
-
- {new Date(item.bookedAt).toISOString().split("T")[0]} -
-
- {item.status === "PENDING" ? ( -
- {item.status} + bookings + .sort( + (a, b) => + new Date(a.bookedAt).getTime() - new Date(b.bookedAt).getTime(), + ) + .map((item: Booking) => ( +
+
{userIdToNameMap[item.userID]}
+
+ {item.item === "ONE_SOUNDBOX" ? ( +

1 soundbox

+ ) : ( +

2 soundbox

+ )} +
+
+ {new Date(item.bookedAt).toISOString().split("T")[0]} +
+
+ {item.status === "PENDING" ? (
- - handleClick({ type: "confirm", data: item }) - } - className="text-green-500 icon-hover cursor-pointer" - /> - - handleClick({ type: "reject", data: item }) - } - className="text-red-500 icon-hover cursor-pointer" - /> + {item.status} +
+ + handleClick({ type: "confirm", data: item }) + } + className="text-green-500 icon-hover cursor-pointer" + /> + + handleClick({ type: "reject", data: item }) + } + className="text-red-500 icon-hover cursor-pointer" + /> +
-
- ) : ( -
{item.status}
- )} -
-
- - + ) : ( +
{item.status}
+ )} +
+
+ + +
-
- )) + )) ) : (
No bookings found
)} {openForm && booked && ( - save("")}/> - }/> + save("")} + /> + } + /> )}
diff --git a/frontend/src/components/footer/footer.tsx b/frontend/src/components/footer/footer.tsx index 8698b4c..653feaa 100644 --- a/frontend/src/components/footer/footer.tsx +++ b/frontend/src/components/footer/footer.tsx @@ -9,11 +9,16 @@ import { Clover } from "lucide-react"; import Modal from "../ui/modal"; import { Button } from "../ui/button"; import { Komite } from "@/schemas/komite"; +import { Hovedsamarbeidspartner } from "@prisma/client"; interface dataProps { message: string; data: Samarbeidspartner[]; } +interface HSPProps { + data: Hovedsamarbeidspartner[]; + message: string; +} const Footer: FC = () => { const [openModal, setOpenModal] = useState(false); @@ -29,6 +34,13 @@ const Footer: FC = () => { error: komiteError, } = useFetch("/api/komite"); + const { + data: dataHSP, + loading: loadingHSP, + error: errorHSP, + } = useFetch("api/hovedsamarbeidspartner"); + const HSP = dataHSP ? dataHSP.data : []; + const [styret, setStyret] = useState([]); const [leder, setLeder] = useState(); const [komiteLeder, setKomiteLeder] = useState(); @@ -202,7 +214,27 @@ const Footer: FC = () => { - +
+ {loadingHSP ? ( + // Maintain the space for the logos by wrapping in a fixed-size container +
+ ) : ( + HSP.map((index: any) => ( +
+ + {index.navn} + +
+ )) + )} +
{/* Social media links */}
@@ -252,7 +284,6 @@ const Footer: FC = () => {
-