From f6bf21a911dee43800cb5c4f2e47e74c6eb2a53f Mon Sep 17 00:00:00 2001 From: Toba Ojo Date: Thu, 18 Sep 2025 15:14:47 +0100 Subject: [PATCH] tweaked sizing and added refresh btn --- .../SightingModal/SightingModal.tsx | 181 ++++++++++-------- src/components/UI/Header.tsx | 12 +- src/pages/Dashboard.tsx | 3 +- 3 files changed, 111 insertions(+), 85 deletions(-) diff --git a/src/components/SightingModal/SightingModal.tsx b/src/components/SightingModal/SightingModal.tsx index 31afe06..d132acc 100644 --- a/src/components/SightingModal/SightingModal.tsx +++ b/src/components/SightingModal/SightingModal.tsx @@ -3,6 +3,8 @@ import type { SightingType } from "../../types/types"; import NumberPlate from "../PlateStack/NumberPlate"; import ModalComponent from "../UI/ModalComponent"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { useAlertHitContext } from "../../context/AlertHitContext"; +import { toast, Toaster } from "sonner"; type SightingModalProps = { isSightingModalOpen: boolean; @@ -15,99 +17,116 @@ const SightingModal = ({ handleClose, sighting, }: SightingModalProps) => { + const { dispatch } = useAlertHitContext(); + + const handleAcknowledgeButton = () => { + if (!sighting) { + toast.error("Cannot add sigthing to alert list"); + handleClose(); + return; + } + dispatch({ type: "ADD", payload: sighting }); + toast.success("Sighting successfully added to alert list"); + handleClose(); + }; + const motionAway = (sighting?.motion ?? "").toUpperCase() === "AWAY"; return ( - -
-
-

Sighting Details

-
- -
-
-
- -
- + <> + +
+
+

+ Sighting Details +

+
+
+ + plate patch +
+
overview patch +
- +
+ + +
- -
- - -
-
- + + + ); }; diff --git a/src/components/UI/Header.tsx b/src/components/UI/Header.tsx index 13f4e23..ad3fc8a 100644 --- a/src/components/UI/Header.tsx +++ b/src/components/UI/Header.tsx @@ -6,6 +6,7 @@ import { faListCheck, faMaximize, faMinimize, + faRotate, } from "@fortawesome/free-solid-svg-icons"; import type { VersionFieldType } from "../../types/types"; import { useEffect, useState } from "react"; @@ -54,6 +55,10 @@ export default function Header() { } }; + const refreshBrowser = () => { + window.location.reload(); + }; + useEffect(() => { const ac = new AbortController(); fetchVersions(ac.signal) @@ -94,7 +99,7 @@ export default function Header() {
{/* Right: Texts stacked + icons */}
-
+

Local: {localStr}

UTC: {utcStr}

@@ -105,8 +110,11 @@ export default function Header() { ) : ( )} - {/* {isFullscreen ? "Shrink" : "enlarge"} */}
+
+ +
+ { const folkestoneUrl = import.meta.env.VITE_FOLKESTONE_URL; - const outsideCamUrl = import.meta.env.VITE_MAV_URL; return (
@@ -17,7 +16,7 @@ const Dashboard = () => { /> - +