rearage top nav bar
This commit is contained in:
parent
7a019ccd32
commit
23b98960cc
7 changed files with 92 additions and 98 deletions
|
@ -1,7 +1,6 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Avatar, AvatarFallback } from "@app/components/ui/avatar";
|
import { Avatar, AvatarFallback } from "@app/components/ui/avatar";
|
||||||
import { Badge } from "@app/components/ui/badge";
|
|
||||||
import { Button } from "@app/components/ui/button";
|
import { Button } from "@app/components/ui/button";
|
||||||
import {
|
import {
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
|
@ -12,7 +11,14 @@ import {
|
||||||
DropdownMenuSeparator,
|
DropdownMenuSeparator,
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from "@app/components/ui/dropdown-menu";
|
} from "@app/components/ui/dropdown-menu";
|
||||||
import { Separator } from "@app/components/ui/separator";
|
import {
|
||||||
|
Select,
|
||||||
|
SelectContent,
|
||||||
|
SelectGroup,
|
||||||
|
SelectItem,
|
||||||
|
SelectTrigger,
|
||||||
|
SelectValue,
|
||||||
|
} from "@app/components/ui/select";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
|
||||||
type HeaderProps = {
|
type HeaderProps = {
|
||||||
|
@ -33,41 +39,14 @@ export default function Header({ email, orgName, name }: HeaderProps) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<div className="flex items-center">
|
|
||||||
<Badge variant="default" className="text-md font-bold">
|
|
||||||
{orgName}
|
|
||||||
</Badge>
|
|
||||||
|
|
||||||
<div className="hidden md:block">
|
|
||||||
<div className="flex items-center gap-4 ml-4">
|
|
||||||
<Link
|
|
||||||
href="/docs"
|
|
||||||
className="text-primary hover:text-primary"
|
|
||||||
>
|
|
||||||
Documentation
|
|
||||||
</Link>
|
|
||||||
<Link
|
|
||||||
href="/support"
|
|
||||||
className="text-primary hover:text-primary"
|
|
||||||
>
|
|
||||||
Support
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="flex items-center gap-4">
|
<div className="flex items-center gap-4">
|
||||||
{/* Make the text truncate on smaller screens */}
|
|
||||||
<span className="text-lg font-medium truncate max-w-[150px] md:max-w-none">
|
|
||||||
{name || email}
|
|
||||||
</span>
|
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
<DropdownMenuTrigger asChild>
|
<DropdownMenuTrigger asChild>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="outline"
|
||||||
className="relative h-10 w-10 rounded-full"
|
className="relative h-10 w-10 rounded-full"
|
||||||
>
|
>
|
||||||
<Avatar className="h-10 w-10">
|
<Avatar className="h-9 w-9">
|
||||||
<AvatarFallback>
|
<AvatarFallback>
|
||||||
{getInitials()}
|
{getInitials()}
|
||||||
</AvatarFallback>
|
</AvatarFallback>
|
||||||
|
@ -76,7 +55,7 @@ export default function Header({ email, orgName, name }: HeaderProps) {
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent
|
<DropdownMenuContent
|
||||||
className="w-56"
|
className="w-56"
|
||||||
align="end"
|
align="start"
|
||||||
forceMount
|
forceMount
|
||||||
>
|
>
|
||||||
<DropdownMenuLabel className="font-normal">
|
<DropdownMenuLabel className="font-normal">
|
||||||
|
@ -93,11 +72,46 @@ export default function Header({ email, orgName, name }: HeaderProps) {
|
||||||
</DropdownMenuLabel>
|
</DropdownMenuLabel>
|
||||||
<DropdownMenuSeparator />
|
<DropdownMenuSeparator />
|
||||||
<DropdownMenuGroup>
|
<DropdownMenuGroup>
|
||||||
<Link href="/profile"><DropdownMenuItem>Profile</DropdownMenuItem></Link>
|
<DropdownMenuItem>Profile</DropdownMenuItem>
|
||||||
<DropdownMenuItem>Log out</DropdownMenuItem>
|
<DropdownMenuItem>Log out</DropdownMenuItem>
|
||||||
</DropdownMenuGroup>
|
</DropdownMenuGroup>
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
|
<span className="truncate max-w-[150px] md:max-w-none">
|
||||||
|
{name || email}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex items-center">
|
||||||
|
<div className="hidden md:block">
|
||||||
|
<div className="flex items-center gap-4 mr-4">
|
||||||
|
<Link
|
||||||
|
href="/docs"
|
||||||
|
className="text-muted-foreground hover:text-black"
|
||||||
|
>
|
||||||
|
Documentation
|
||||||
|
</Link>
|
||||||
|
<Link
|
||||||
|
href="/support"
|
||||||
|
className="text-muted-foreground hover:text-black"
|
||||||
|
>
|
||||||
|
Support
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Select defaultValue={orgName}>
|
||||||
|
<SelectTrigger className="w-[100px] md:w-[180px]">
|
||||||
|
<SelectValue placeholder="Select an org" />
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectContent>
|
||||||
|
<SelectGroup>
|
||||||
|
<SelectItem value={orgName}>
|
||||||
|
{orgName}
|
||||||
|
</SelectItem>
|
||||||
|
</SelectGroup>
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -40,8 +40,8 @@ export function TopbarNav({
|
||||||
className={cn(
|
className={cn(
|
||||||
"px-2 py-3 text-md",
|
"px-2 py-3 text-md",
|
||||||
pathname.startsWith(item.href.replace("{orgId}", orgId))
|
pathname.startsWith(item.href.replace("{orgId}", orgId))
|
||||||
? "border-b-2 border-base-600 text-base-600"
|
? "border-b-2 border-primary text-primary font-medium"
|
||||||
: "hover:text-gray-600 text-base-400",
|
: "hover:text-primary text-muted-foreground font-medium",
|
||||||
"whitespace-nowrap",
|
"whitespace-nowrap",
|
||||||
disabled && "cursor-not-allowed",
|
disabled && "cursor-not-allowed",
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -50,8 +50,8 @@ export default async function ConfigurationLaytout({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="w-full bg-secondary border-b border-secondary mb-8 select-none sm:px-0 px-3">
|
<div className="w-full bg-neutral-100 border-b border-neutral-200 mb-6 select-none sm:px-0 px-3 pt-3">
|
||||||
<div className="container mx-auto flex flex-col content-between gap-4 pt-2">
|
<div className="container mx-auto flex flex-col content-between gap-4">
|
||||||
<Header email={user.email} orgName={params.orgId} />
|
<Header email={user.email} orgName={params.orgId} />
|
||||||
<TopbarNav items={topNavItems} orgId={params.orgId} />
|
<TopbarNav items={topNavItems} orgId={params.orgId} />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -22,10 +22,6 @@ const sidebarNavItems = [
|
||||||
title: "Notifications",
|
title: "Notifications",
|
||||||
href: "/{orgId}/resources/{resourceId}/notifications",
|
href: "/{orgId}/resources/{resourceId}/notifications",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "Display",
|
|
||||||
href: "/{orgId}/resources/{resourceId}/display",
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
|
|
||||||
interface SettingsLayoutProps {
|
interface SettingsLayoutProps {
|
||||||
|
@ -36,23 +32,7 @@ interface SettingsLayoutProps {
|
||||||
export default function SettingsLayout({ children, params }: SettingsLayoutProps) {
|
export default function SettingsLayout({ children, params }: SettingsLayoutProps) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="md:hidden">
|
<div>
|
||||||
<Image
|
|
||||||
src="/configuration/forms-light.png"
|
|
||||||
width={1280}
|
|
||||||
height={791}
|
|
||||||
alt="Forms"
|
|
||||||
className="block dark:hidden"
|
|
||||||
/>
|
|
||||||
<Image
|
|
||||||
src="/configuration/forms-dark.png"
|
|
||||||
width={1280}
|
|
||||||
height={791}
|
|
||||||
alt="Forms"
|
|
||||||
className="hidden dark:block"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="hidden space-y-6 p-10 pb-16 md:block">
|
|
||||||
<div className="space-y-0.5">
|
<div className="space-y-0.5">
|
||||||
<h2 className="text-2xl font-bold tracking-tight">Settings</h2>
|
<h2 className="text-2xl font-bold tracking-tight">Settings</h2>
|
||||||
<p className="text-muted-foreground">
|
<p className="text-muted-foreground">
|
||||||
|
|
|
@ -74,7 +74,7 @@ export default async function SettingsLayout({ children, params }: SettingsLayou
|
||||||
className="hidden dark:block"
|
className="hidden dark:block"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="hidden space-y-6 p-10 pb-16 md:block">
|
<div className="hidden space-y-6 0 pb-16 md:block">
|
||||||
<div className="space-y-0.5">
|
<div className="space-y-0.5">
|
||||||
<h2 className="text-2xl font-bold tracking-tight">Settings</h2>
|
<h2 className="text-2xl font-bold tracking-tight">Settings</h2>
|
||||||
<p className="text-muted-foreground">
|
<p className="text-muted-foreground">
|
||||||
|
|
|
@ -4,48 +4,48 @@
|
||||||
|
|
||||||
@layer base {
|
@layer base {
|
||||||
:root {
|
:root {
|
||||||
--background: 37 0% 95%;
|
--background: 231 0% 100%;
|
||||||
--foreground: 37 0% 10%;
|
--foreground: 231 0% 10%;
|
||||||
--card: 37 0% 90%;
|
--card: 231 0% 100%;
|
||||||
--card-foreground: 37 0% 15%;
|
--card-foreground: 231 0% 15%;
|
||||||
--popover: 37 0% 95%;
|
--popover: 231 0% 100%;
|
||||||
--popover-foreground: 37 95% 10%;
|
--popover-foreground: 231 95% 10%;
|
||||||
--primary: 37 31% 25%;
|
--primary: 231 34% 49%;
|
||||||
--primary-foreground: 0 0% 100%;
|
--primary-foreground: 0 0% 100%;
|
||||||
--secondary: 37 10% 74%;
|
--secondary: 231 10% 90%;
|
||||||
--secondary-foreground: 0 0% 0%;
|
--secondary-foreground: 0 0% 0%;
|
||||||
--muted: -1 10% 85%;
|
--muted: 193 10% 95%;
|
||||||
--muted-foreground: 37 0% 40%;
|
--muted-foreground: 231 0% 40%;
|
||||||
--accent: -1 10% 80%;
|
--accent: 193 10% 90%;
|
||||||
--accent-foreground: 37 0% 15%;
|
--accent-foreground: 231 0% 15%;
|
||||||
--destructive: 0 50% 50%;
|
--destructive: 0 50% 50%;
|
||||||
--destructive-foreground: 37 0% 90%;
|
--destructive-foreground: 231 0% 100%;
|
||||||
--border: 37 20% 74%;
|
--border: 231 20% 82%;
|
||||||
--input: 37 20% 50%;
|
--input: 231 20% 50%;
|
||||||
--ring: 37 31% 25%;
|
--ring: 231 34% 49%;
|
||||||
--radius: 0.5rem;
|
--radius: 0.75rem;
|
||||||
}
|
}
|
||||||
.dark {
|
.dark {
|
||||||
--background: 37 10% 10%;
|
--background: 231 10% 10%;
|
||||||
--foreground: 37 0% 90%;
|
--foreground: 231 0% 100%;
|
||||||
--card: 37 0% 10%;
|
--card: 231 0% 10%;
|
||||||
--card-foreground: 37 0% 90%;
|
--card-foreground: 231 0% 100%;
|
||||||
--popover: 37 10% 5%;
|
--popover: 231 10% 5%;
|
||||||
--popover-foreground: 37 0% 90%;
|
--popover-foreground: 231 0% 100%;
|
||||||
--primary: 37 31% 25%;
|
--primary: 231 34% 49%;
|
||||||
--primary-foreground: 0 0% 100%;
|
--primary-foreground: 0 0% 100%;
|
||||||
--secondary: 37 10% 20%;
|
--secondary: 231 10% 20%;
|
||||||
--secondary-foreground: 0 0% 100%;
|
--secondary-foreground: 0 0% 100%;
|
||||||
--muted: -1 10% 25%;
|
--muted: 193 10% 25%;
|
||||||
--muted-foreground: 37 0% 65%;
|
--muted-foreground: 231 0% 65%;
|
||||||
--accent: -1 10% 25%;
|
--accent: 193 10% 25%;
|
||||||
--accent-foreground: 37 0% 90%;
|
--accent-foreground: 231 0% 95%;
|
||||||
--destructive: 0 50% 50%;
|
--destructive: 0 50% 50%;
|
||||||
--destructive-foreground: 37 0% 90%;
|
--destructive-foreground: 231 0% 100%;
|
||||||
--border: 37 20% 50%;
|
--border: 231 20% 50%;
|
||||||
--input: 37 20% 50%;
|
--input: 231 20% 50%;
|
||||||
--ring: 37 31% 25%;
|
--ring: 231 34% 49%;
|
||||||
--radius: 0.5rem;
|
--radius: 0.75rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
import { Roboto } from "next/font/google";
|
import { Inter, Roboto } from "next/font/google";
|
||||||
import { Toaster } from "@/components/ui/toaster"
|
import { Toaster } from "@/components/ui/toaster";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: process.env.NEXT_PUBLIC_APP_NAME,
|
title: process.env.NEXT_PUBLIC_APP_NAME,
|
||||||
description: "",
|
description: "",
|
||||||
};
|
};
|
||||||
|
|
||||||
const font = Roboto({ subsets: ["latin"], style: "normal", weight: "400" });
|
const font = Inter({ subsets: ["latin"] });
|
||||||
|
|
||||||
export default async function RootLayout({
|
export default async function RootLayout({
|
||||||
children,
|
children,
|
||||||
|
@ -17,7 +17,7 @@ export default async function RootLayout({
|
||||||
}>) {
|
}>) {
|
||||||
return (
|
return (
|
||||||
<html>
|
<html>
|
||||||
<body className={`${font.className}`}>
|
<body className={`${font.className} pb-3`}>
|
||||||
<main>{children}</main>
|
<main>{children}</main>
|
||||||
<Toaster />
|
<Toaster />
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Add table
Reference in a new issue