Update root sidebar header and actions
This commit is contained in:
@@ -2,9 +2,9 @@ import type { ReactNode } from "react";
|
||||
import {
|
||||
ArrowLeft,
|
||||
FolderKanban,
|
||||
Globe2,
|
||||
ImageIcon,
|
||||
LayoutDashboard,
|
||||
LogOut,
|
||||
PlusSquare,
|
||||
ShieldAlert,
|
||||
SwatchBook,
|
||||
@@ -27,13 +27,14 @@ type RootDashboardCopy = {
|
||||
uiKit: string;
|
||||
portfolio: string;
|
||||
media: string;
|
||||
siteSettings: string;
|
||||
logout: string;
|
||||
backToSite: string;
|
||||
};
|
||||
|
||||
type RootDashboardShellProps = {
|
||||
copy: RootDashboardCopy;
|
||||
active: "overview" | "maintenance" | "ui-kit" | "portfolio" | "media";
|
||||
active: "overview" | "maintenance" | "ui-kit" | "portfolio" | "media" | "site-settings";
|
||||
portfolioChild?: "overview" | "projects" | "new-project" | "categories";
|
||||
logoutAction: () => Promise<void>;
|
||||
headerTitle: string;
|
||||
@@ -64,6 +65,8 @@ export function RootDashboardShell({
|
||||
? ShieldAlert
|
||||
: active === "ui-kit"
|
||||
? SwatchBook
|
||||
: active === "site-settings"
|
||||
? Globe2
|
||||
: active === "media"
|
||||
? ImageIcon
|
||||
: portfolioChild === "categories"
|
||||
@@ -74,18 +77,6 @@ export function RootDashboardShell({
|
||||
const sharedActions = (
|
||||
<>
|
||||
<ThemeToggle ariaLabel="Theme wechseln" />
|
||||
<Button asChild variant="outline" size="sm">
|
||||
<Link href={getLocalizedPath("de")}>
|
||||
<ArrowLeft className="h-4 w-4" />
|
||||
{copy.backToSite}
|
||||
</Link>
|
||||
</Button>
|
||||
<form action={logoutAction}>
|
||||
<Button type="submit" variant="ghost" size="sm" className="text-destructive hover:bg-destructive/10 hover:text-destructive">
|
||||
<LogOut className="h-4 w-4" />
|
||||
{copy.logout}
|
||||
</Button>
|
||||
</form>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -95,6 +86,14 @@ export function RootDashboardShell({
|
||||
description={headerDescription}
|
||||
icon={headerIcon}
|
||||
items={sidebarItems}
|
||||
sidebarTop={
|
||||
<Button asChild variant="outline" className="w-full justify-between">
|
||||
<Link href={getLocalizedPath("de")} target="_blank" rel="noreferrer">
|
||||
{copy.backToSite}
|
||||
<ArrowLeft className="h-4 w-4" />
|
||||
</Link>
|
||||
</Button>
|
||||
}
|
||||
sidebarFooter={
|
||||
<>
|
||||
<Button
|
||||
@@ -117,6 +116,11 @@ export function RootDashboardShell({
|
||||
<SwatchBook className="h-4 w-4" />
|
||||
</Link>
|
||||
</Button>
|
||||
<form action={logoutAction}>
|
||||
<Button type="submit" variant="ghost" className="w-full justify-between text-destructive hover:bg-destructive/10 hover:text-destructive">
|
||||
{copy.logout}
|
||||
</Button>
|
||||
</form>
|
||||
</>
|
||||
}
|
||||
headerActions={
|
||||
|
||||
Reference in New Issue
Block a user