From 984eb093a0fc090d8e170a872319ddcd3370fb4b Mon Sep 17 00:00:00 2001 From: nocnico Date: Mon, 2 Jun 2025 22:01:45 +0200 Subject: [PATCH] Edit Navbar Connection, Fix Tracker Grammar, Auto Redirect on Dispatch Main Page, Adjust Toast Position --- .../dispatch/app/_components/map/BaseMaps.tsx | 2 +- .../navbar/_components/Connection.tsx | 37 ++++++++++--------- apps/dispatch/app/layout.tsx | 2 +- apps/dispatch/app/page.tsx | 23 ++++++------ .../navbar/_components/Connection.tsx | 10 ++--- .../_components/ConnectedDispatcher.tsx | 6 ++- 6 files changed, 42 insertions(+), 38 deletions(-) diff --git a/apps/dispatch/app/_components/map/BaseMaps.tsx b/apps/dispatch/app/_components/map/BaseMaps.tsx index 13b95956..6c377602 100644 --- a/apps/dispatch/app/_components/map/BaseMaps.tsx +++ b/apps/dispatch/app/_components/map/BaseMaps.tsx @@ -314,7 +314,7 @@ export const BaseMaps = () => { return ( - + diff --git a/apps/dispatch/app/dispatch/_components/navbar/_components/Connection.tsx b/apps/dispatch/app/dispatch/_components/navbar/_components/Connection.tsx index 5023e6ab..c25f4581 100644 --- a/apps/dispatch/app/dispatch/_components/navbar/_components/Connection.tsx +++ b/apps/dispatch/app/dispatch/_components/navbar/_components/Connection.tsx @@ -2,6 +2,7 @@ import { useSession } from "next-auth/react"; import { useDispatchConnectionStore } from "../../../../_store/dispatch/connectionStore"; import { useRef, useState } from "react"; +import { toast } from "react-hot-toast"; export const ConnectionBtn = () => { const modalRef = useRef(null); @@ -10,6 +11,7 @@ export const ConnectionBtn = () => { logoffTime: "", selectedZone: "LST_01", }); + const [logoffDebounce, setLogoffDebounce] = useState(null); const session = useSession(); const uid = session.data?.user?.id; if (!uid) return null; @@ -22,14 +24,14 @@ export const ConnectionBtn = () => { {connection.status == "connected" ? ( ) : ( )} @@ -50,10 +50,7 @@ export const ConnectionBtn = () => {
{connection.status == "connected" ? (

- Verbunden als{" "} - - <{connection.selectedZone}> - + Verbunden als <{connection.selectedZone}>

) : (

Als Disponent anmelden

@@ -62,26 +59,30 @@ export const ConnectionBtn = () => { {connection.status == "disconnected" && ( -

- Du kannst diese Zeit später noch anpassen. -

+

Du kannst diese Zeit später noch anpassen.

)}
- + {connection.status == "connected" ? ( ) : ( + {connection.status == "connected" ? ( ) : (