1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-05-29 22:37:44 +02:00

build(deps): update Next.js to v15 and ESLint to v9

This commit is contained in:
2024-11-09 19:50:22 +01:00
parent 59153a7a69
commit 9e840b8dae
74 changed files with 3206 additions and 3749 deletions

View File

@ -1,5 +1,5 @@
import "@repo/config-tailwind/styles.css"
import type { LocaleProps } from "@repo/i18n/config"
import type { LocaleProps } from "@repo/i18n/routing"
import type { Locale } from "@repo/utils/constants"
import { LOCALES } from "@repo/utils/constants"
import type { Metadata } from "next"
@ -7,18 +7,19 @@ import { NextIntlClientProvider } from "next-intl"
import {
getMessages,
getTranslations,
unstable_setRequestLocale,
setRequestLocale,
} from "next-intl/server"
export const generateMetadata = async ({
params,
}: LocaleProps): Promise<Metadata> => {
const t = await getTranslations({ locale: params.locale })
const { locale } = await params
const t = await getTranslations({ locale })
const title = t("meta.title")
const description = `${title} - ${t("meta.description")}`
const image = "/images/logo.webp"
const url = new URL("https://theoludwig.fr")
const locale = LOCALES.join(", ")
const locales = LOCALES.join(", ")
return {
title,
@ -36,7 +37,7 @@ export const generateMetadata = async ({
height: 96,
},
],
locale,
locale: locales,
type: "website",
},
twitter: {
@ -61,13 +62,14 @@ interface LocaleLayoutProps extends React.PropsWithChildren, LocaleProps {}
const LocaleLayout: React.FC<LocaleLayoutProps> = async (props) => {
const { children, params } = props
const { locale } = await params
// Enable static rendering
unstable_setRequestLocale(params.locale)
setRequestLocale(locale)
const messages = await getMessages()
return (
<html lang={params.locale} suppressHydrationWarning>
<html lang={locale} suppressHydrationWarning>
<body>
<NextIntlClientProvider messages={messages}>
{children}