From 32973cdcdb17558a3ef897ae9d985d3b5c91341c Mon Sep 17 00:00:00 2001 From: Jacob Ellerbrock Date: Tue, 15 Apr 2025 13:32:20 -0500 Subject: [PATCH] Updated to have select dropdown --- apps/web/src/app/admin/layout.tsx | 13 ++++- .../shared/MobileAdminTabSelect.tsx | 53 +++++++++++++++++++ 2 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 apps/web/src/components/shared/MobileAdminTabSelect.tsx diff --git a/apps/web/src/app/admin/layout.tsx b/apps/web/src/app/admin/layout.tsx index a573520b..df39ed7c 100644 --- a/apps/web/src/app/admin/layout.tsx +++ b/apps/web/src/app/admin/layout.tsx @@ -10,6 +10,7 @@ import { Suspense } from "react"; import ClientToast from "@/components/shared/ClientToast"; import { redirect } from "next/navigation"; import { getUser } from "db/functions"; +import MobileAdminTabSelect from "@/components/shared/MobileAdminTabSelect"; interface AdminLayoutProps { children: React.ReactNode; @@ -38,7 +39,7 @@ export default async function AdminLayout({ children }: AdminLayoutProps) { <>
-
+
+ {/*show dorpdown for mobile*/} +
+ + +
+
-
+ + {/*show tabs for non-mobile*/} +
{Object.entries(c.dashPaths.admin).map(([name, path]) => ( ))} diff --git a/apps/web/src/components/shared/MobileAdminTabSelect.tsx b/apps/web/src/components/shared/MobileAdminTabSelect.tsx new file mode 100644 index 00000000..d9d4102d --- /dev/null +++ b/apps/web/src/components/shared/MobileAdminTabSelect.tsx @@ -0,0 +1,53 @@ +"use client"; +import { redirect, usePathname } from "next/navigation"; +import { + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectLabel, + SelectTrigger, + SelectValue, +} from "@/components/shadcn/ui/select"; +import c from "config"; + +export default function MobileAdminTabSelect() { + let curPath = usePathname().slice(7); + curPath = curPath.charAt(0).toUpperCase() + curPath.slice(1); + if (curPath == "") curPath = "Overview"; + if (curPath == "check-in") curPath = "Hackathon Check-in"; + + return ( + + ); +}