diff --git a/apps/dispatch/app/(app)/_components/Navbar.tsx b/apps/dispatch/app/(app)/_components/Navbar.tsx new file mode 100644 index 00000000..0bcb448c --- /dev/null +++ b/apps/dispatch/app/(app)/_components/Navbar.tsx @@ -0,0 +1,32 @@ +import { ExitIcon } from "@radix-ui/react-icons"; +import Link from "next/link"; +import { prisma } from "@repo/db"; +import { ChangelogWrapper } from "_components/navbar/ChangelogWrapper"; +import ModeSwitchDropdown from "_components/navbar/ModeSwitchDropdown"; + +export default async function Navbar({ children }: { children: React.ReactNode }) { + const latestChangelog = await prisma.changelog.findFirst({ + orderBy: { + createdAt: "desc", + }, + }); + return ( +
+
+
+

VAR Operations Center

+ +
+
+
+ {children} + + + + +
+
+ ); +} diff --git a/apps/dispatch/app/(app)/dispatch/_components/navbar/_components/Connection.tsx b/apps/dispatch/app/(app)/dispatch/_components/navbar/Connection.tsx similarity index 98% rename from apps/dispatch/app/(app)/dispatch/_components/navbar/_components/Connection.tsx rename to apps/dispatch/app/(app)/dispatch/_components/navbar/Connection.tsx index 039d7ac2..c09dec31 100644 --- a/apps/dispatch/app/(app)/dispatch/_components/navbar/_components/Connection.tsx +++ b/apps/dispatch/app/(app)/dispatch/_components/navbar/Connection.tsx @@ -1,7 +1,7 @@ /* eslint-disable react-hooks/exhaustive-deps */ "use client"; import { useSession } from "next-auth/react"; -import { useDispatchConnectionStore } from "../../../../../_store/dispatch/connectionStore"; +import { useDispatchConnectionStore } from "../../../../_store/dispatch/connectionStore"; import { useEffect, useRef, useState } from "react"; import { useMutation } from "@tanstack/react-query"; import { Prisma } from "@repo/db"; diff --git a/apps/dispatch/app/(app)/dispatch/_components/navbar/Navbar.tsx b/apps/dispatch/app/(app)/dispatch/_components/navbar/Navbar.tsx deleted file mode 100644 index d1bd729e..00000000 --- a/apps/dispatch/app/(app)/dispatch/_components/navbar/Navbar.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import { Connection } from "./_components/Connection"; -import { Audio } from "../../../../_components/Audio/Audio"; -import { ExitIcon, ExternalLinkIcon } from "@radix-ui/react-icons"; -import Link from "next/link"; -import { Settings } from "./_components/Settings"; -import AdminPanel from "_components/navbar/AdminPanel"; -import { getServerSession } from "api/auth/[...nextauth]/auth"; -import { WarningAlert } from "_components/navbar/PageAlert"; -import { Radar } from "lucide-react"; -import { ChangelogWrapper } from "_components/navbar/ChangelogWrapper"; -import { prisma } from "@repo/db"; - -export default async function Navbar() { - const session = await getServerSession(); - const latestChangelog = await prisma.changelog.findFirst({ - orderBy: { - createdAt: "desc", - }, - }); - - return ( -
-
-
-

VAR Leitstelle

- -
- {session?.user.permissions.includes("ADMIN_KICK") && } -
- -
-
-
-
- -
-
- - - - - - - - - - -
-
-
- ); -} diff --git a/apps/dispatch/app/(app)/dispatch/_components/navbar/_components/Settings.tsx b/apps/dispatch/app/(app)/dispatch/_components/navbar/Settings.tsx similarity index 100% rename from apps/dispatch/app/(app)/dispatch/_components/navbar/_components/Settings.tsx rename to apps/dispatch/app/(app)/dispatch/_components/navbar/Settings.tsx diff --git a/apps/dispatch/app/(app)/dispatch/_components/navbar/_components/ThemeSwap.tsx b/apps/dispatch/app/(app)/dispatch/_components/navbar/_components/ThemeSwap.tsx deleted file mode 100644 index dec2a6fd..00000000 --- a/apps/dispatch/app/(app)/dispatch/_components/navbar/_components/ThemeSwap.tsx +++ /dev/null @@ -1,26 +0,0 @@ -"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/(app)/dispatch/layout.tsx b/apps/dispatch/app/(app)/dispatch/layout.tsx index bade8d8d..3c1da056 100644 --- a/apps/dispatch/app/(app)/dispatch/layout.tsx +++ b/apps/dispatch/app/(app)/dispatch/layout.tsx @@ -1,7 +1,10 @@ import type { Metadata } from "next"; -import Navbar from "./_components/navbar/Navbar"; import { getServerSession } from "api/auth/[...nextauth]/auth"; import { Error } from "_components/Error"; +import Navbar from "(app)/_components/Navbar"; +import { Audio } from "_components/Audio/Audio"; +import { Connection } from "./_components/navbar/Connection"; +import { Settings } from "./_components/navbar/Settings"; export const metadata: Metadata = { title: "VAR: Disponent", @@ -26,7 +29,11 @@ export default async function RootLayout({ return ( <> - + + {children} ); diff --git a/apps/dispatch/app/(app)/pilot/_components/navbar/_components/Connection.tsx b/apps/dispatch/app/(app)/pilot/_components/navbar/Connection.tsx similarity index 100% rename from apps/dispatch/app/(app)/pilot/_components/navbar/_components/Connection.tsx rename to apps/dispatch/app/(app)/pilot/_components/navbar/Connection.tsx diff --git a/apps/dispatch/app/(app)/pilot/_components/navbar/Navbar.tsx b/apps/dispatch/app/(app)/pilot/_components/navbar/Navbar.tsx deleted file mode 100644 index 39013bc1..00000000 --- a/apps/dispatch/app/(app)/pilot/_components/navbar/Navbar.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import { Connection } from "./_components/Connection"; -import { Audio } from "_components/Audio/Audio"; -import { ExitIcon, ExternalLinkIcon } from "@radix-ui/react-icons"; -import Link from "next/link"; -import { Settings } from "./_components/Settings"; -import { WarningAlert } from "_components/navbar/PageAlert"; -import { Radar } from "lucide-react"; -import { prisma } from "@repo/db"; -import { ChangelogWrapper } from "_components/navbar/ChangelogWrapper"; - -export default async function Navbar() { - const latestChangelog = await prisma.changelog.findFirst({ - orderBy: { - createdAt: "desc", - }, - }); - return ( -
-
-
-

VAR Operations Center

- -
-
- -
-
-
-
- -
-
- - - - - - - - - - -
-
-
- ); -} diff --git a/apps/dispatch/app/(app)/pilot/_components/navbar/_components/Settings.tsx b/apps/dispatch/app/(app)/pilot/_components/navbar/Settings.tsx similarity index 100% rename from apps/dispatch/app/(app)/pilot/_components/navbar/_components/Settings.tsx rename to apps/dispatch/app/(app)/pilot/_components/navbar/Settings.tsx diff --git a/apps/dispatch/app/(app)/pilot/_components/navbar/_components/ThemeSwap.tsx b/apps/dispatch/app/(app)/pilot/_components/navbar/_components/ThemeSwap.tsx deleted file mode 100644 index dec2a6fd..00000000 --- a/apps/dispatch/app/(app)/pilot/_components/navbar/_components/ThemeSwap.tsx +++ /dev/null @@ -1,26 +0,0 @@ -"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/(app)/pilot/layout.tsx b/apps/dispatch/app/(app)/pilot/layout.tsx index ab71548f..12029fe7 100644 --- a/apps/dispatch/app/(app)/pilot/layout.tsx +++ b/apps/dispatch/app/(app)/pilot/layout.tsx @@ -1,7 +1,10 @@ import type { Metadata } from "next"; -import Navbar from "./_components/navbar/Navbar"; import { getServerSession } from "api/auth/[...nextauth]/auth"; import { Error } from "_components/Error"; +import Navbar from "(app)/_components/Navbar"; +import { Audio } from "_components/Audio/Audio"; +import { Connection } from "./_components/navbar/Connection"; +import { Settings } from "./_components/navbar/Settings"; export const metadata: Metadata = { title: "VAR: Pilot", @@ -26,7 +29,11 @@ export default async function RootLayout({ return ( <> - + + {children} ); diff --git a/apps/dispatch/app/_components/navbar/ModeSwitchDropdown.tsx b/apps/dispatch/app/_components/navbar/ModeSwitchDropdown.tsx index 24b0448f..372f3853 100644 --- a/apps/dispatch/app/_components/navbar/ModeSwitchDropdown.tsx +++ b/apps/dispatch/app/_components/navbar/ModeSwitchDropdown.tsx @@ -1,18 +1,24 @@ "use client"; import { cn } from "@repo/shared-components"; -import { ArrowLeftRight, Plane, Radar, Workflow } from "lucide-react"; +import { ArrowLeftRight, ExternalLinkIcon, Plane, Radar, Workflow } from "lucide-react"; import { useSession } from "next-auth/react"; import Link from "next/link"; import { usePathname } from "next/navigation"; -export default function ModeSwitchDropdown({ className }: { className?: string }) { +export default function ModeSwitchDropdown({ + className, + btnClassName, +}: { + className?: string; + btnClassName?: string; +}) { const path = usePathname(); const session = useSession(); return (
-
+
{path.includes("pilot") && "Pilot"} {path.includes("dispatch") && "Leitstelle"}
@@ -39,6 +45,15 @@ export default function ModeSwitchDropdown({ className }: { className?: string } Tracker +
  • + + HUB + +
  • ); diff --git a/apps/hub-server/modules/discord.ts b/apps/hub-server/modules/discord.ts index e36f3430..7cff86b4 100644 --- a/apps/hub-server/modules/discord.ts +++ b/apps/hub-server/modules/discord.ts @@ -36,6 +36,7 @@ export const removeRolesFromMember = async (memberId: string, roleIds: string[]) console.error("Error removing roles from member:", error); }); }; + export const setStandardName = async ({ memberId, userId, diff --git a/apps/hub/app/_components/BookingTimelineModal.tsx b/apps/hub/app/_components/BookingTimelineModal.tsx index f647a1b8..15d80dd8 100644 --- a/apps/hub/app/_components/BookingTimelineModal.tsx +++ b/apps/hub/app/_components/BookingTimelineModal.tsx @@ -9,6 +9,7 @@ import { Button } from "@repo/shared-components"; import { formatTimeRange } from "../../helper/timerange"; import toast from "react-hot-toast"; import Link from "next/link"; +import { error } from "console"; interface BookingTimelineModalProps { isOpen: boolean; @@ -318,12 +319,7 @@ export const BookingTimelineModal = ({ {canDeleteBooking(booking.User.publicId) && (