- Enhanced the CardInfos component in [cod].tsx with improved styling and added TrafficCone icon for status indication. - Increased dialog content width in prezziario.tsx and testi-stringhe.tsx for better layout. - Replaced static badge elements with the Badge component in chi-siamo.tsx, contatti.tsx, guida.tsx, prezzi.tsx, and proprietari.tsx for consistent styling. - Updated button components to use the Button component in contatti.tsx and proprietari.tsx for improved accessibility and styling. - Modified the TrovaCasaCTA and FrequentSearches components in index.tsx for better visual consistency and updated color usage. - Refactored global CSS variables for improved color management and added new color variables for better theme support. - Implemented dynamic loading for the KabanExample component in test.tsx to enhance performance.
51 lines
1.6 KiB
TypeScript
51 lines
1.6 KiB
TypeScript
"use client";
|
|
import { usePathname } from "next/navigation";
|
|
import { useState } from "react";
|
|
import { UserHeaderSection } from "~/components/navbar/login-button";
|
|
import { MainNav } from "~/components/navbar/main-nav";
|
|
import { MobileNav } from "~/components/navbar/mobile-nav";
|
|
import { RicercaCommand } from "~/components/navbar/ricerca_command";
|
|
import { SettingsPopover } from "~/components/navbar/settings-modal";
|
|
|
|
export function SiteHeader() {
|
|
const pathname = usePathname();
|
|
const [openSidebar, setOpenSidebar] = useState(false);
|
|
const [openUserMenu, setOpenUserMenu] = useState(false);
|
|
const [openUserMenuSidebar, setOpenUserMenuSidebar] = useState(false);
|
|
|
|
const handleOpenMenu = (status: boolean) => {
|
|
setOpenUserMenu(status);
|
|
};
|
|
|
|
const handleOpenSidebar = (status: boolean) => {
|
|
setOpenSidebar(status);
|
|
};
|
|
return (
|
|
<header className="sticky top-0 z-50 w-full border-muted border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
|
|
<div className="mx-auto flex h-14 w-full items-center pr-3 pl-4 md:pr-4 md:pl-8">
|
|
<MainNav />
|
|
<MobileNav
|
|
open={openSidebar}
|
|
pathname={pathname}
|
|
setOpen={setOpenSidebar}
|
|
setUserOpen={setOpenUserMenuSidebar}
|
|
userOpen={openUserMenuSidebar}
|
|
/>
|
|
|
|
<div className="float-end flex flex-1 items-center justify-end gap-0.5">
|
|
<RicercaCommand />
|
|
|
|
<div className="hidden md:block">
|
|
<SettingsPopover />
|
|
</div>
|
|
<UserHeaderSection
|
|
key={pathname}
|
|
open={openUserMenu}
|
|
setOpen={handleOpenMenu}
|
|
setSidebar={handleOpenSidebar}
|
|
/>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
);
|
|
}
|