From 65fa2a62716865ff59ba174825f84239cedad4de Mon Sep 17 00:00:00 2001 From: nocnico Date: Thu, 22 May 2025 01:14:00 +0200 Subject: [PATCH] Add Settings to Navbar, disable ThemeSwap (who uses light-mode anyway) --- .../dispatch/_components/navbar/Navbar.tsx | 12 +- .../navbar/_components/Connection.tsx | 2 +- .../navbar/_components/Settings.tsx | 103 ++++++++++++++++++ .../app/pilot/_components/navbar/Navbar.tsx | 12 +- .../app/pilot/_components/navbar/Settings.tsx | 103 ++++++++++++++++++ 5 files changed, 221 insertions(+), 11 deletions(-) create mode 100644 apps/dispatch/app/dispatch/_components/navbar/_components/Settings.tsx create mode 100644 apps/dispatch/app/pilot/_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 1bdabca4..bd3a30dc 100644 --- a/apps/dispatch/app/dispatch/_components/navbar/Navbar.tsx +++ b/apps/dispatch/app/dispatch/_components/navbar/Navbar.tsx @@ -1,14 +1,15 @@ "use client"; import { Connection } from "./_components/Connection"; -import { ThemeSwap } from "./_components/ThemeSwap"; +/* import { ThemeSwap } from "./_components/ThemeSwap"; */ import { Audio } from "../../../_components/Audio"; -import { useState } from "react"; +/* import { useState } from "react"; */ import { ExitIcon, ExternalLinkIcon } from "@radix-ui/react-icons"; import Link from "next/link"; +import { SettingsBtn } from "./_components/Settings"; export default function Navbar() { - const [isDark, setIsDark] = useState(false); + /* const [isDark, setIsDark] = useState(false); const toggleTheme = () => { const newTheme = !isDark; @@ -17,7 +18,7 @@ export default function Navbar() { "data-theme", newTheme ? "nord" : "dark", ); - }; + }; */ return (
@@ -32,8 +33,9 @@ export default function Navbar() {
- + {/* */}
+ { onClick={() => { modalRef.current?.showModal(); }} - className="btn btn-soft btn-info" + className="btn btn-sm btn-soft btn-info" > {connection.status == "disconnected" ? "Verbinden" diff --git a/apps/dispatch/app/dispatch/_components/navbar/_components/Settings.tsx b/apps/dispatch/app/dispatch/_components/navbar/_components/Settings.tsx new file mode 100644 index 00000000..5a51934f --- /dev/null +++ b/apps/dispatch/app/dispatch/_components/navbar/_components/Settings.tsx @@ -0,0 +1,103 @@ +"use client"; +import { useRef } from "react"; +import { GearIcon } from "@radix-ui/react-icons"; +import { SettingsIcon, Volume2 } from "lucide-react"; + +export const SettingsBtn = () => { + const modalRef = useRef(null); + + return ( +
+ + + +
+

+ Einstellungen +

+
+
+ +
+ {/* FÜGE HIER BITTE DEN MIKROFONAUSSCHLAG EIN WIE IN DER V1 */} +
+
+

+ Ausgabelautstärke +

+
+ +
+ 0 + 25 + 50 + 75 + 100 +
+
+ +
+ + +
+
+
+
+ ); +}; + +export const Settings = () => { + return ( +
+ +
+ ); +}; diff --git a/apps/dispatch/app/pilot/_components/navbar/Navbar.tsx b/apps/dispatch/app/pilot/_components/navbar/Navbar.tsx index 53cfc32e..53241866 100644 --- a/apps/dispatch/app/pilot/_components/navbar/Navbar.tsx +++ b/apps/dispatch/app/pilot/_components/navbar/Navbar.tsx @@ -1,14 +1,15 @@ "use client"; import { Connection } from "./Connection"; -import { ThemeSwap } from "./ThemeSwap"; +/* import { ThemeSwap } from "./ThemeSwap"; */ import { Audio } from "../../../_components/Audio"; -import { useState } from "react"; +/* import { useState } from "react"; */ import { ExitIcon, ExternalLinkIcon } from "@radix-ui/react-icons"; import Link from "next/link"; +import { Settings } from "./Settings"; export default function Navbar() { - const [isDark, setIsDark] = useState(false); + /* const [isDark, setIsDark] = useState(false); const toggleTheme = () => { const newTheme = !isDark; @@ -17,7 +18,7 @@ export default function Navbar() { "data-theme", newTheme ? "nord" : "dark", ); - }; + }; */ return (
@@ -32,8 +33,9 @@ export default function Navbar() {
- + {/* */}
+ { + const modalRef = useRef(null); + + return ( +
+ + + +
+

+ Einstellungen +

+
+
+ +
+ {/* FÜGE HIER BITTE DEN MIKROFONAUSSCHLAG EIN WIE IN DER V1 */} +
+
+

+ Ausgabelautstärke +

+
+ +
+ 0 + 25 + 50 + 75 + 100 +
+
+ +
+ + +
+
+
+
+ ); +}; + +export const Settings = () => { + return ( +
+ +
+ ); +};