From ba90cd13be797148aacd462db5c499984263b171 Mon Sep 17 00:00:00 2001 From: lucuswolfius Date: Sun, 1 Jun 2025 13:02:10 -0700 Subject: [PATCH 1/2] Added a pilot/dispatch mode switch dropdown --- .../_components/navbar/ModeSwitchDropdown.tsx | 30 +++++++++++++++++++ .../app/_components/{ => navbar}/Settings.tsx | 0 .../dispatch/_components/navbar/Navbar.tsx | 8 ++--- .../app/pilot/_components/navbar/Navbar.tsx | 8 ++--- 4 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 apps/dispatch/app/_components/navbar/ModeSwitchDropdown.tsx rename apps/dispatch/app/_components/{ => navbar}/Settings.tsx (100%) diff --git a/apps/dispatch/app/_components/navbar/ModeSwitchDropdown.tsx b/apps/dispatch/app/_components/navbar/ModeSwitchDropdown.tsx new file mode 100644 index 00000000..a79fbb70 --- /dev/null +++ b/apps/dispatch/app/_components/navbar/ModeSwitchDropdown.tsx @@ -0,0 +1,30 @@ +"use client"; + +import { ArrowLeftRight, Plane, Workflow } from "lucide-react"; +import Link from "next/link"; +import { usePathname } from "next/navigation"; + +export default function ModeSwitchDropdown() { + const path = usePathname(); + + return ( +
+ + {path.includes("pilot") && "Pilot"} + {path.includes("dispatch") && "Leitstelle"} + + +
+ ); +} diff --git a/apps/dispatch/app/_components/Settings.tsx b/apps/dispatch/app/_components/navbar/Settings.tsx similarity index 100% rename from apps/dispatch/app/_components/Settings.tsx rename to apps/dispatch/app/_components/navbar/Settings.tsx diff --git a/apps/dispatch/app/dispatch/_components/navbar/Navbar.tsx b/apps/dispatch/app/dispatch/_components/navbar/Navbar.tsx index a0ab4768..f919d210 100644 --- a/apps/dispatch/app/dispatch/_components/navbar/Navbar.tsx +++ b/apps/dispatch/app/dispatch/_components/navbar/Navbar.tsx @@ -6,7 +6,8 @@ import { Audio } from "../../../_components/Audio"; /* import { useState } from "react"; */ import { ExitIcon, ExternalLinkIcon } from "@radix-ui/react-icons"; import Link from "next/link"; -import { Settings } from "_components/Settings"; +import { Settings } from "_components/navbar/Settings"; +import ModeSwitchDropdown from "_components/navbar/ModeSwitchDropdown"; export default function Navbar() { /* const [isDark, setIsDark] = useState(false); @@ -22,10 +23,7 @@ export default function Navbar() { return (
-
- VAR Leitstelle V2 -
- +