-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlayout.tsx
58 lines (51 loc) · 1.6 KB
/
layout.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import "./globals.css";
import { Analytics } from "@vercel/analytics/react";
import { Inter } from "next/font/google";
import { notFound } from "next/navigation";
import { useMessages } from "next-intl";
import Footer from "@/components/Footer";
import NavBar from "@/components/layout/navbar";
import { locales } from "@/navigation";
import UsernameDialog from "./_components/UsernameDialog";
import Providers from "./Providers";
const inter = Inter({
subsets: ["latin"],
display: "swap",
variable: "--font-inter",
});
export const metadata = {
title: "Festival Chooselife",
description: "Site oficial do festival Chooselife",
};
export default function RootLayout({
children,
params: { locale },
}: {
children: React.ReactNode;
params: { locale: "en" | "pt" };
}) {
// Validate that the incoming `locale` parameter is valid
if (!locales.includes(locale)) notFound();
const messages = useMessages();
return (
// suppressHydrationWarning because of `next-themes`
// refer to https://github.com/pacocoursey/next-themes#with-app
<html lang={locale} suppressHydrationWarning>
<body
className={`min-h-screen bg-gray-50 dark:bg-gray-900 md:px-0 ${inter.variable} font-sans`}
>
<Providers locale={locale} messages={messages}>
<div className="relative flex h-full min-h-screen flex-col">
<NavBar />
<main className="container mx-auto flex-1">
<UsernameDialog />
{children}
</main>
<Footer />
</div>
</Providers>
<Analytics />
</body>
</html>
);
}