Skip to content

Commit

Permalink
fix: Read locale from params in layout (#7178)
Browse files Browse the repository at this point in the history
Co-authored-by: Claudio Wunder <[email protected]>
  • Loading branch information
amannn and ovflowd authored Nov 4, 2024
1 parent 593c11f commit 0049911
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apps/site/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Analytics } from '@vercel/analytics/react';
import { SpeedInsights } from '@vercel/speed-insights/next';
import classNames from 'classnames';
import { getLocale } from 'next-intl/server';
import type { FC, PropsWithChildren } from 'react';

import BaseLayout from '@/layouts/Base';
Expand All @@ -15,8 +14,10 @@ import '@/styles/index.css';

const fontClasses = classNames(IBM_PLEX_MONO.variable, OPEN_SANS.variable);

const RootLayout: FC<PropsWithChildren> = async ({ children }) => {
const locale = await getLocale();
type RotLayoutProps = PropsWithChildren<{ params: { locale: string } }>;

const RootLayout: FC<RotLayoutProps> = async ({ children, params }) => {
const { locale } = await params;

const { langDir, hrefLang } = availableLocalesMap[locale] || defaultLocale;

Expand Down

0 comments on commit 0049911

Please sign in to comment.