-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #189 from nr2f1/footer-fix
fix: not found and language locale
- Loading branch information
Showing
3 changed files
with
91 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import Footer from '@components/footer'; | ||
import Header from '@components/header'; | ||
import { AVAILABLE_LOCALES } from '@i18n/locales'; | ||
import type { PagePropsWithLocale } from '@shared/types/page-with-locale-params'; | ||
import { Nunito_Sans } from 'next/font/google'; | ||
|
||
const nunitoSans = Nunito_Sans({ | ||
display: 'swap', | ||
subsets: ['latin'], | ||
variable: '--font-nunito-sans', | ||
adjustFontFallback: false, | ||
preload: true, | ||
}); | ||
|
||
export const metadata = { | ||
title: 'NR2F1 Foundation', | ||
metadataBase: new URL('https://website-nr2f1.vercel.app'), // TODO: update this once we migrate | ||
alternates: { | ||
canonical: '/', | ||
languages: { | ||
en: '/en', | ||
de: '/de', | ||
es: '/es', | ||
fr: '/fr', | ||
}, | ||
}, | ||
}; | ||
|
||
export async function generateStaticParams() { | ||
return AVAILABLE_LOCALES.map((lang) => ({ lang })); | ||
} | ||
|
||
interface RootLayoutProps extends PagePropsWithLocale { | ||
children: React.ReactNode; | ||
} | ||
|
||
const RootLayout: React.FC<RootLayoutProps> = async ({ children, params }) => { | ||
const { lang } = await params; | ||
|
||
return ( | ||
<html lang={lang} className={nunitoSans.variable}> | ||
<body> | ||
<Header lang={lang} /> | ||
<main>{children}</main> | ||
<Footer lang={lang} /> | ||
</body> | ||
</html> | ||
); | ||
}; | ||
|
||
export default RootLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters