-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Expand file tree
/
Copy pathlayout.tsx
More file actions
56 lines (46 loc) · 1.54 KB
/
layout.tsx
File metadata and controls
56 lines (46 loc) · 1.54 KB
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
import { Analytics } from '@vercel/analytics/react';
import { SpeedInsights } from '@vercel/speed-insights/next';
import classNames from 'classnames';
import { NextIntlClientProvider } from 'next-intl';
import type { FC, PropsWithChildren } from 'react';
import BaseLayout from '@/layouts/Base';
import { VERCEL_ENV } from '@/next.constants.mjs';
import { IBM_PLEX_MONO, OPEN_SANS } from '@/next.fonts';
import { availableLocalesMap, defaultLocale } from '@/next.locales.mjs';
import { ThemeProvider } from '@/providers/themeProvider';
import '@/styles/index.css';
const fontClasses = classNames(IBM_PLEX_MONO.variable, OPEN_SANS.variable);
type RotLayoutProps = PropsWithChildren<{ params: { locale: string } }>;
const RootLayout: FC<RotLayoutProps> = async ({ children, params }) => {
const { locale } = await params;
const { langDir, hrefLang } = availableLocalesMap[locale] || defaultLocale;
return (
<html
className={fontClasses}
dir={langDir}
lang={hrefLang}
suppressHydrationWarning
>
<body suppressHydrationWarning>
<NextIntlClientProvider>
<ThemeProvider>
<BaseLayout>{children}</BaseLayout>
</ThemeProvider>
</NextIntlClientProvider>
<a
rel="me"
aria-hidden="true"
className="hidden"
href="https://social.lfx.dev/@nodejs"
/>
{VERCEL_ENV && (
<>
<Analytics />
<SpeedInsights />
</>
)}
</body>
</html>
);
};
export default RootLayout;