feat: personalized branding - show '{FirstName} Tools' in sidebar when logged in
This commit is contained in:
@@ -9,6 +9,7 @@ import * as Icons from "lucide-react";
|
||||
import { buildNavigation } from "@/config/navigation";
|
||||
import { COMPANIES } from "@/config/companies";
|
||||
import { useFeatureFlag } from "@/core/feature-flags";
|
||||
import { useAuth } from "@/core/auth/auth-provider";
|
||||
import { cn } from "@/shared/lib/utils";
|
||||
import { ScrollArea } from "@/shared/components/ui/scroll-area";
|
||||
import { Separator } from "@/shared/components/ui/separator";
|
||||
@@ -213,6 +214,14 @@ function SidebarLogos() {
|
||||
export function Sidebar() {
|
||||
const pathname = usePathname();
|
||||
const navGroups = useMemo(() => buildNavigation(), []);
|
||||
const { user } = useAuth();
|
||||
|
||||
const brandingLabel = useMemo(() => {
|
||||
if (!user?.name) return "ArchiTools";
|
||||
const firstName = user.name.split(" ")[0];
|
||||
if (!firstName) return "ArchiTools";
|
||||
return `${firstName} Tools`;
|
||||
}, [user?.name]);
|
||||
|
||||
return (
|
||||
<aside className="flex h-full w-64 shrink-0 flex-col border-r bg-card">
|
||||
@@ -229,7 +238,7 @@ export function Sidebar() {
|
||||
className="block text-center text-base font-semibold tracking-wide transition-colors hover:text-primary"
|
||||
title="Panou principal"
|
||||
>
|
||||
ArchiTools
|
||||
{brandingLabel}
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user