diff --git a/apps/dispatch/.env.example b/apps/dispatch/.env.example index 88aa9476..4f75f0b4 100644 --- a/apps/dispatch/.env.example +++ b/apps/dispatch/.env.example @@ -1,6 +1,7 @@ NEXTAUTH_SECRET= NEXTAUTH_COOKIE_PREFIX= -NEXTAUTH_SECRET= -NEXT_PUBLIC_PUBLIC_URL= -NEXT_PUBLIC_HUB_URL= -NEXT_PUBLIC_SERVICE_ID= \ No newline at end of file +NEXTAUTH_URL=http://localhost:3001 +NEXT_PUBLIC_PUBLIC_URL=http://localhost:3001 +NEXT_PUBLIC_HUB_URL=http://localhost:3000 +NEXT_PUBLIC_SERVICE_ID=1 +NEXT_PUBLIC_DISPATCH_SERVER_URL=http://localhost:3002 \ No newline at end of file diff --git a/apps/dispatch/app/(dispatch)/_components/Connection.tsx b/apps/dispatch/app/(dispatch)/_components/Connection.tsx index b6b97e44..58dc3856 100644 --- a/apps/dispatch/app/(dispatch)/_components/Connection.tsx +++ b/apps/dispatch/app/(dispatch)/_components/Connection.tsx @@ -1,6 +1,86 @@ +"use client"; import { useSession } from "next-auth/react"; import { connectionStore } from "../../_store/connectionStore"; import { useEffect } from "react"; +import { CheckCircledIcon } from "@radix-ui/react-icons"; + +export const ConnectBtn = () => { + return ( + <> + + +
+

Als Disponent anmelden

+
+ +

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

+
+
+
+ + +
+
+
+
+ + ); +}; + +export const ConnectedBtn = () => { + return ( + <> + + +
+

+ Verbunden als <LST_01> +

+
+ +
+
+
+ + +
+
+
+
+ + ); +}; export const Connection = () => { const session = useSession(); @@ -13,5 +93,5 @@ export const Connection = () => { } }, [uid]); - return
{cStore.isConnected ? "Connected" : "Not Connected"}
; + return
{cStore.isConnected ? : }
; }; diff --git a/apps/dispatch/app/(dispatch)/_components/Navbar.tsx b/apps/dispatch/app/(dispatch)/_components/Navbar.tsx deleted file mode 100644 index 08907984..00000000 --- a/apps/dispatch/app/(dispatch)/_components/Navbar.tsx +++ /dev/null @@ -1,81 +0,0 @@ -"use client"; -import { ToggleTalkButton } from "../_components/ToggleTalkButton"; -import { ChangeRufgruppe } from "../_components/ChangeRufgruppe"; -import { Notifications } from "../_components/Notifications"; -import Link from "next/link"; -import { connectionStore } from "../../_store/connectionStore"; -import { useEffect } from "react"; -import { socket } from "../socket"; -import { useSession } from "next-auth/react"; -import { Connection } from "./Connection"; - -export default function Navbar() { - return ( -
-
- VAR Leitstelle V2 -
-
- -
-
- -
-
- -
- -
-
-
- ... -
- -
-
-
- ); -} diff --git a/apps/dispatch/app/(dispatch)/_components/navbar/Navbar.tsx b/apps/dispatch/app/(dispatch)/_components/navbar/Navbar.tsx new file mode 100644 index 00000000..71a96ed8 --- /dev/null +++ b/apps/dispatch/app/(dispatch)/_components/navbar/Navbar.tsx @@ -0,0 +1,70 @@ +"use client"; + +import { ToggleTalkButton } from "../ToggleTalkButton"; +import { ChangeRufgruppe } from "../ChangeRufgruppe"; +import { Notifications } from "../Notifications"; +import Link from "next/link"; +import { Connection } from "../Connection"; +import { ThemeSwap } from "./_components/ThemeSwap"; +import { useState } from "react"; + +export default function Navbar() { + const [isDark, setIsDark] = useState(false); + + const toggleTheme = () => { + const newTheme = !isDark; + setIsDark(newTheme); + document.documentElement.setAttribute( + "data-theme", + newTheme ? "nord" : "dark", + ); + }; + + return ( +
+
+ VAR Leitstelle V2 +
+
+ +
+
+ +
+
+ +
+ +
+
+
+ ... +
+ +
+
+
+ ); +} diff --git a/apps/dispatch/app/(dispatch)/_components/navbar/_components/ThemeSwap.tsx b/apps/dispatch/app/(dispatch)/_components/navbar/_components/ThemeSwap.tsx new file mode 100644 index 00000000..dec2a6fd --- /dev/null +++ b/apps/dispatch/app/(dispatch)/_components/navbar/_components/ThemeSwap.tsx @@ -0,0 +1,26 @@ +"use client"; + +import { MoonIcon, SunIcon } from "@radix-ui/react-icons"; + +interface ThemeSwapProps { + isDark: boolean; + toggleTheme: () => void; +} + +export const ThemeSwap: React.FC = ({ + isDark, + toggleTheme, +}) => { + return ( + + ); +}; diff --git a/apps/dispatch/app/(dispatch)/layout.tsx b/apps/dispatch/app/(dispatch)/layout.tsx index feae307f..b5921107 100644 --- a/apps/dispatch/app/(dispatch)/layout.tsx +++ b/apps/dispatch/app/(dispatch)/layout.tsx @@ -1,5 +1,5 @@ import type { Metadata } from "next"; -import Navbar from "./_components/Navbar"; +import Navbar from "./_components/navbar/Navbar"; import { redirect } from "next/navigation"; import { getServerSession } from "../api/auth/[...nextauth]/auth"; diff --git a/apps/dispatch/app/globals.css b/apps/dispatch/app/globals.css index 4c1b0c2f..dca6a6c6 100644 --- a/apps/dispatch/app/globals.css +++ b/apps/dispatch/app/globals.css @@ -1,2 +1,4 @@ @import "tailwindcss"; -@plugin "daisyui"; +@plugin "daisyui" { + themes: dark, nord; +} diff --git a/apps/hub/.env.example b/apps/hub/.env.example index fa7e22ba..b413bd3f 100644 --- a/apps/hub/.env.example +++ b/apps/hub/.env.example @@ -1,4 +1,4 @@ -NEXTAUTH_URL= +NEXTAUTH_URL=http://localhost:3000 NEXTAUTH_SECRET= NEXT_PUBLIC_MOODLE_URL= DATABASE_URL=