This commit is contained in:
@@ -38,12 +38,11 @@ export default async function SiteLayout({ children, params }: SiteLayoutProps)
|
|||||||
<div className="relative flex min-h-screen flex-col overflow-hidden">
|
<div className="relative flex min-h-screen flex-col overflow-hidden">
|
||||||
<SiteAmbientBackdrop />
|
<SiteAmbientBackdrop />
|
||||||
<SiteHeader
|
<SiteHeader
|
||||||
isAdmin={authenticated}
|
|
||||||
lightLogoUrl={mediaBindings.siteLogoLight?.url}
|
lightLogoUrl={mediaBindings.siteLogoLight?.url}
|
||||||
darkLogoUrl={mediaBindings.siteLogoDark?.url}
|
darkLogoUrl={mediaBindings.siteLogoDark?.url}
|
||||||
/>
|
/>
|
||||||
<main className="flex-1">{children}</main>
|
<main className="flex-1">{children}</main>
|
||||||
<SiteFooter isAdmin={authenticated} />
|
<SiteFooter />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import Link from "next/link";
|
|||||||
import { useLocale, useTranslations } from "next-intl";
|
import { useLocale, useTranslations } from "next-intl";
|
||||||
|
|
||||||
import { Container } from "@/components/layout/container";
|
import { Container } from "@/components/layout/container";
|
||||||
import { buildAdminUrl } from "@/lib/admin-routing";
|
|
||||||
import { getLocalizedPath } from "@/lib/locale";
|
import { getLocalizedPath } from "@/lib/locale";
|
||||||
|
|
||||||
const navItems = [
|
const navItems = [
|
||||||
@@ -12,11 +11,7 @@ const navItems = [
|
|||||||
{ key: "contact", path: "/contact" },
|
{ key: "contact", path: "/contact" },
|
||||||
];
|
];
|
||||||
|
|
||||||
type SiteFooterProps = {
|
export function SiteFooter() {
|
||||||
isAdmin?: boolean;
|
|
||||||
};
|
|
||||||
|
|
||||||
export function SiteFooter({ isAdmin = false }: SiteFooterProps) {
|
|
||||||
const locale = useLocale();
|
const locale = useLocale();
|
||||||
const tNav = useTranslations("navigation");
|
const tNav = useTranslations("navigation");
|
||||||
const tFooter = useTranslations("footer");
|
const tFooter = useTranslations("footer");
|
||||||
@@ -34,11 +29,6 @@ export function SiteFooter({ isAdmin = false }: SiteFooterProps) {
|
|||||||
{tNav(item.key)}
|
{tNav(item.key)}
|
||||||
</Link>
|
</Link>
|
||||||
))}
|
))}
|
||||||
{isAdmin ? (
|
|
||||||
<a href={buildAdminUrl()} className="text-muted-foreground hover:text-foreground">
|
|
||||||
{tNav("admin")}
|
|
||||||
</a>
|
|
||||||
) : null}
|
|
||||||
</nav>
|
</nav>
|
||||||
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
||||||
<p className="text-xs text-muted-foreground/80">
|
<p className="text-xs text-muted-foreground/80">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { AnimatePresence, motion, useReducedMotion } from "framer-motion";
|
import { AnimatePresence, motion, useReducedMotion } from "framer-motion";
|
||||||
import { LayoutDashboard, Menu, X } from "lucide-react";
|
import { Menu, X } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from "next/navigation";
|
||||||
import { useLocale, useTranslations } from "next-intl";
|
import { useLocale, useTranslations } from "next-intl";
|
||||||
@@ -13,7 +13,6 @@ import { SiteLogo } from "@/components/layout/site-logo";
|
|||||||
import { SoundToggle } from "@/components/sound-toggle";
|
import { SoundToggle } from "@/components/sound-toggle";
|
||||||
import { ThemeToggle } from "@/components/theme-toggle";
|
import { ThemeToggle } from "@/components/theme-toggle";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { buildAdminUrl } from "@/lib/admin-routing";
|
|
||||||
import { getLocalizedPath, stripLocalePrefix } from "@/lib/locale";
|
import { getLocalizedPath, stripLocalePrefix } from "@/lib/locale";
|
||||||
import { toast } from "@/lib/toast";
|
import { toast } from "@/lib/toast";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
@@ -33,7 +32,6 @@ const disabledMobileNavItemClassName =
|
|||||||
"relative inline-flex cursor-not-allowed items-center justify-center rounded-nested px-4 py-3 text-sm font-medium text-foreground/55";
|
"relative inline-flex cursor-not-allowed items-center justify-center rounded-nested px-4 py-3 text-sm font-medium text-foreground/55";
|
||||||
|
|
||||||
type SiteHeaderProps = {
|
type SiteHeaderProps = {
|
||||||
isAdmin?: boolean;
|
|
||||||
lightLogoUrl?: string | null;
|
lightLogoUrl?: string | null;
|
||||||
darkLogoUrl?: string | null;
|
darkLogoUrl?: string | null;
|
||||||
};
|
};
|
||||||
@@ -142,7 +140,6 @@ function NavLinks({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function SiteHeader({
|
export function SiteHeader({
|
||||||
isAdmin = false,
|
|
||||||
lightLogoUrl,
|
lightLogoUrl,
|
||||||
darkLogoUrl,
|
darkLogoUrl,
|
||||||
}: SiteHeaderProps) {
|
}: SiteHeaderProps) {
|
||||||
@@ -313,13 +310,6 @@ export function SiteHeader({
|
|||||||
variant="ghost"
|
variant="ghost"
|
||||||
className={desktopControlButtonClassName}
|
className={desktopControlButtonClassName}
|
||||||
/>
|
/>
|
||||||
{isAdmin ? (
|
|
||||||
<Button asChild variant="ghost" size="icon" className={desktopControlButtonClassName}>
|
|
||||||
<Link href={buildAdminUrl()} aria-label={t("admin")}>
|
|
||||||
<LayoutDashboard className="h-4 w-4 transition-transform duration-300 ease-out hover:scale-110" />
|
|
||||||
</Link>
|
|
||||||
</Button>
|
|
||||||
) : null}
|
|
||||||
</div>
|
</div>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
|
||||||
@@ -463,13 +453,6 @@ export function SiteHeader({
|
|||||||
variant="ghost"
|
variant="ghost"
|
||||||
className={mobileControlButtonClassName}
|
className={mobileControlButtonClassName}
|
||||||
/>
|
/>
|
||||||
{isAdmin ? (
|
|
||||||
<Button asChild variant="ghost" size="icon" className={mobileControlButtonClassName}>
|
|
||||||
<Link href={buildAdminUrl()} aria-label={t("admin")} onClick={() => setIsOpen(false)}>
|
|
||||||
<LayoutDashboard className="h-4 w-4 transition-transform duration-300 ease-out hover:scale-110" />
|
|
||||||
</Link>
|
|
||||||
</Button>
|
|
||||||
) : null}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
|||||||
Reference in New Issue
Block a user