60 lines
1.9 KiB
TypeScript
60 lines
1.9 KiB
TypeScript
import { Head, usePage } from "@inertiajs/react";
|
|
import { type ReactNode } from "react";
|
|
|
|
import BackToTop from "@/front/partials/BackToTop";
|
|
import Footer from "@/front/partials/Footer";
|
|
import useDeviceType from "@/hooks/use-device-type";
|
|
|
|
import { positionBannerButton } from "../Components/cookie/constants";
|
|
import CookieNotice from "../Components/cookie/CookieNotice";
|
|
import { RecaptchaProvider } from "../Components/cookie/recaptcha/RecaptchaProvider";
|
|
import Navbar from "../partials/Navbar";
|
|
|
|
interface AppLayoutProps {
|
|
children: ReactNode;
|
|
}
|
|
|
|
export default function AppLayout({ children }: Readonly<AppLayoutProps>) {
|
|
const { isMobile } = useDeviceType();
|
|
const { canonical } = usePage().props as { canonical?: string };
|
|
return (
|
|
<RecaptchaProvider>
|
|
<div className="flex min-h-screen flex-col">
|
|
<CookieNotice
|
|
services={["matomo"] as const}
|
|
learnMoreHref={route("front.privacy-policy")}
|
|
bannerButtonPosition={
|
|
isMobile ? positionBannerButton.aside.left : undefined
|
|
}
|
|
hasLogo
|
|
variants={{
|
|
btnActionVariant: "secondary",
|
|
bannerBtnVariant: "default",
|
|
closeBtnVariant: "ghost",
|
|
serviceBg: "bg-secondary border-black",
|
|
switchBg: "data-[state=checked]:bg-black",
|
|
}}
|
|
texts={{
|
|
size: "normal",
|
|
services: {
|
|
description: "text-black-600",
|
|
link: "text-blue-500",
|
|
title: "text-red-500",
|
|
},
|
|
modal: {
|
|
description: "text-black-600",
|
|
link: "text-blue-500",
|
|
title: "text-red-500",
|
|
},
|
|
}}
|
|
/>
|
|
|
|
<Head>{canonical && <link rel="canonical" href={canonical} />}</Head>
|
|
<Navbar />
|
|
<main className="flex-1 pb-20 lg:pb-0">{children}</main>
|
|
<Footer />
|
|
<BackToTop />
|
|
</div>
|
|
</RecaptchaProvider>
|
|
);
|
|
}
|