mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Working on style and color on the side bar, and the items buttons.
This commit is contained in:
@@ -1,26 +1,37 @@
|
||||
|
||||
import {
|
||||
Sidebar,
|
||||
SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent,
|
||||
SidebarGroupLabel,
|
||||
SidebarHeader,
|
||||
SidebarMenu,
|
||||
SidebarMenu, SidebarMenuAction,
|
||||
SidebarMenuButton,
|
||||
SidebarMenuItem,
|
||||
} from "@/components/ui/sidebar"
|
||||
import {DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger} from "@/components/ui/dropdown-menu";
|
||||
import {Calendar, ChevronDown, ChevronUp, Home, Inbox, Search, Settings, User2} from "lucide-react";
|
||||
import {
|
||||
Calendar,
|
||||
ChartArea,
|
||||
ChevronDown,
|
||||
ChevronUp,
|
||||
Home,
|
||||
Inbox,
|
||||
Search,
|
||||
Settings,
|
||||
ShieldHalf,
|
||||
User2
|
||||
} from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import {signOutAction} from "@/features/auth/auth.action";
|
||||
import {UserAvatar} from "@/components/wrappers/Dashboard/UserAvatar/UserAvatar";
|
||||
import {LoggedInDropdown} from "@/components/wrappers/Dashboard/LoggedInDropdown/LoggedInDropdown";
|
||||
import {LoggedInButton} from "@/components/wrappers/Dashboard/LoggedInButton/LoggedInButton";
|
||||
import {Button, buttonVariants} from "@/components/ui/button"
|
||||
import {cn} from "@/lib/utils";
|
||||
|
||||
|
||||
export function AppSidebar() {
|
||||
|
||||
|
||||
|
||||
|
||||
const BASE_URL = "/dashboard";
|
||||
|
||||
// Menu items.
|
||||
@@ -31,23 +42,18 @@ export function AppSidebar() {
|
||||
icon: Home,
|
||||
},
|
||||
{
|
||||
title: "Inbox",
|
||||
url: "/home",
|
||||
icon: Inbox,
|
||||
title: "Agents",
|
||||
url: "agents",
|
||||
icon: ShieldHalf,
|
||||
},
|
||||
{
|
||||
title: "Calendar",
|
||||
url: "#",
|
||||
icon: Calendar,
|
||||
},
|
||||
{
|
||||
title: "Search",
|
||||
url: "#",
|
||||
icon: Search,
|
||||
title: "Statistic",
|
||||
url: "kpi",
|
||||
icon: ChartArea,
|
||||
},
|
||||
{
|
||||
title: "Settings",
|
||||
url: "#",
|
||||
url: "settings",
|
||||
icon: Settings,
|
||||
},
|
||||
]
|
||||
@@ -59,10 +65,10 @@ export function AppSidebar() {
|
||||
<SidebarMenuItem>
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<SidebarMenuButton>
|
||||
Select Workspace
|
||||
<ChevronDown className="ml-auto" />
|
||||
</SidebarMenuButton>
|
||||
<SidebarMenuButton>
|
||||
Select Workspace
|
||||
<ChevronDown className="ml-auto"/>
|
||||
</SidebarMenuButton>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent className="w-[--radix-popper-anchor-width]">
|
||||
<DropdownMenuItem>
|
||||
@@ -83,14 +89,20 @@ export function AppSidebar() {
|
||||
<SidebarMenu>
|
||||
{items.map((item) => (
|
||||
<SidebarMenuItem key={item.title}>
|
||||
<SidebarMenuButton asChild>
|
||||
<Link href={`${BASE_URL}/${item.url}`}>
|
||||
<item.icon />
|
||||
<span>{item.title}</span>
|
||||
<SidebarMenuButton asChild >
|
||||
<Link
|
||||
className={cn(buttonVariants({size: "lg", variant: "ghost"}), "justify-start p-0")}
|
||||
href={`${BASE_URL}/${item.url}`}>
|
||||
<item.icon/>
|
||||
<span>{item.title}</span>
|
||||
</Link>
|
||||
</SidebarMenuButton>
|
||||
<SidebarMenuAction className="peer-data-[active=true]/menu-button:opacity-100" />
|
||||
|
||||
</SidebarMenuItem>
|
||||
|
||||
))}
|
||||
|
||||
</SidebarMenu>
|
||||
</SidebarGroupContent>
|
||||
</SidebarGroup>
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import Image from "next/image"
|
||||
import {Layout} from "@/components/layout";
|
||||
import Link from "next/link";
|
||||
import {Badge} from "@/components/ui/badge";
|
||||
import {currentUser} from "@/auth/current-user";
|
||||
import {notFound} from "next/navigation";
|
||||
import {buttonVariants} from "@/components/ui/button";
|
||||
import {LoggedInButton} from "@/components/wrappers/Dashboard/LoggedInButton/LoggedInButton";
|
||||
import {SidebarTrigger} from "@/components/ui/sidebar";
|
||||
import {ModeToggle} from "@/features/theme/ModeToggle";
|
||||
|
||||
export const Header = async () => {
|
||||
const user = await currentUser()
|
||||
if (!user) {
|
||||
return notFound()
|
||||
}
|
||||
return (
|
||||
<header className="flex h-16 shrink-0 items-center justify-between border-b px-4">
|
||||
<SidebarTrigger className="-ml-1"/>
|
||||
<div className="flex items-center gap-2">
|
||||
<ModeToggle/>
|
||||
<LoggedInButton/>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
"use client"
|
||||
|
||||
import * as React from "react"
|
||||
import { Moon, Sun } from "lucide-react"
|
||||
import { useTheme } from "next-themes"
|
||||
|
||||
import { Button } from "@/components/ui/button"
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu"
|
||||
|
||||
export function ModeToggle() {
|
||||
const { setTheme } = useTheme()
|
||||
|
||||
return (
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button variant="ghost" size="sm">
|
||||
<Sun className="size-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
|
||||
<Moon className="absolute size-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
|
||||
<span className="sr-only">Toggle theme</span>
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end">
|
||||
<DropdownMenuItem onClick={() => setTheme("light")}>
|
||||
Light
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => setTheme("dark")}>
|
||||
Dark
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => setTheme("system")}>
|
||||
System
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user