Refine root sidebar and header controls

This commit is contained in:
MOH
2026-03-08 23:16:36 +01:00
parent 1d4c2f8e72
commit 3e835ee620
5 changed files with 103 additions and 56 deletions
+14 -16
View File
@@ -1,6 +1,5 @@
import type { ReactNode } from "react";
import {
ArrowLeft,
FolderKanban,
Globe2,
ImageIcon,
@@ -20,7 +19,6 @@ import { FormSaveButton } from "@/components/root/form-save-button";
import { SidebarMaintenanceControl } from "@/components/root/sidebar-maintenance-control";
import { ThemeToggle } from "@/components/theme-toggle";
import { Button } from "@/components/ui/button";
import { Separator } from "@/components/ui/separator";
import { getMaintenanceMode, getSiteSettingsMediaBindings } from "@/lib/app-config";
import { getLocalizedPath } from "@/lib/locale";
import { getRootNavigation } from "@/lib/root-navigation";
@@ -82,9 +80,17 @@ export async function RootDashboardShell({
getSiteSettingsMediaBindings(),
getMaintenanceMode(),
]);
const normalizedSidebarItems = getRootNavigation(copy, active, smtpChild, portfolioChild).filter(
(item) => item.href !== "/root/maintenance" && item.href !== "/root/ui-kit",
const sidebarItems = getRootNavigation(copy, active, smtpChild, portfolioChild);
const normalizedSidebarItems = sidebarItems.filter(
(item) =>
item.href !== "/root/maintenance" &&
item.href !== "/root/ui-kit" &&
item.href !== "/root/smtp" &&
item.href !== "/root/marquee",
);
const footerSidebarItems = ["/root/marquee", "/root/smtp"]
.map((href) => sidebarItems.find((item) => item.href === href))
.filter((item): item is NonNullable<typeof item> => Boolean(item));
const headerIcon =
active === "overview"
? LayoutDashboard
@@ -124,17 +130,10 @@ export async function RootDashboardShell({
icon={headerIcon}
items={normalizedSidebarItems}
sidebarIconSrc={mediaBindings.favicon?.url}
sidebarTop={
<div className="space-y-2">
<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>
{sidebarTopContent}
</div>
}
sidebarBrandHref={getLocalizedPath("de")}
sidebarBrandHoverLabel={copy.backToSite}
sidebarTop={sidebarTopContent}
sidebarFooterItems={footerSidebarItems}
sidebarFooter={
<>
<SidebarMaintenanceControl
@@ -160,7 +159,6 @@ export async function RootDashboardShell({
<LogOut className="h-4 w-4" />
</Button>
</form>
<Separator />
</>
}
headerActions={