From 1f768be0485bbfa6b542dd24183fe8389acb9355 Mon Sep 17 00:00:00 2001 From: Md Saban <45597394+mdsaban@users.noreply.github.com> Date: Sat, 12 Oct 2024 18:37:20 +0530 Subject: feature(web): Introduce a new sticky navbar. Fixes 520 (#515) * ui: add global header * fix: design fixes * fix: tests * fix navbar background, hide y scrollbar and change sidebar footer to show version --------- Co-authored-by: MohamedBassem --- apps/web/components/dashboard/header/Header.tsx | 71 +++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 apps/web/components/dashboard/header/Header.tsx (limited to 'apps/web/components/dashboard/header/Header.tsx') diff --git a/apps/web/components/dashboard/header/Header.tsx b/apps/web/components/dashboard/header/Header.tsx new file mode 100644 index 00000000..11e3b3c3 --- /dev/null +++ b/apps/web/components/dashboard/header/Header.tsx @@ -0,0 +1,71 @@ +import React from "react"; +import Link from "next/link"; +import { redirect } from "next/navigation"; +import GlobalActions from "@/components/dashboard/GlobalActions"; +import ProfileOptions from "@/components/dashboard/header/ProfileOptions"; +import { SearchInput } from "@/components/dashboard/search/SearchInput"; +import HoarderLogo from "@/components/HoarderIcon"; +import { Button } from "@/components/ui/button"; +import { + Tooltip, + TooltipContent, + TooltipTrigger, +} from "@/components/ui/tooltip"; +import { getServerAuthSession } from "@/server/auth"; +import { Settings, Shield } from "lucide-react"; + +export default async function Header() { + const session = await getServerAuthSession(); + if (!session) { + redirect("/"); + } + + const adminItem = + session.user.role == "admin" + ? [ + { + name: "Admin", + icon: , + path: "/dashboard/admin", + }, + ] + : []; + + const headerItems = [ + ...adminItem, + { + name: "Settings", + icon: , + path: "/dashboard/settings", + }, + ]; + + return ( +
+
+ + + +
+
+ + +
+
+ {headerItems.map((item) => ( + + + + + {item.name} + + ))} + +
+
+ ); +} -- cgit v1.2.3-70-g09d2