added tons of features
This commit is contained in:
33
app/[locale]/layout.tsx
Normal file
33
app/[locale]/layout.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import {NextIntlClientProvider} from 'next-intl'
|
||||
import {getMessages} from 'next-intl/server'
|
||||
import {notFound} from 'next/navigation'
|
||||
import {ReactNode} from 'react'
|
||||
|
||||
import {routing} from '@/i18n/routing'
|
||||
import {TIMEZONE} from '@/lib/constants'
|
||||
|
||||
export default async function RootLayout({
|
||||
children,
|
||||
params
|
||||
}: Readonly<{
|
||||
children: ReactNode
|
||||
params: Promise<{locale: string}>
|
||||
}>) {
|
||||
const {locale} = await params
|
||||
if (!routing.locales.includes(locale as any)) {
|
||||
notFound()
|
||||
}
|
||||
|
||||
const messages = await getMessages()
|
||||
//const queryClient = new QueryClient()
|
||||
|
||||
return (
|
||||
<NextIntlClientProvider
|
||||
messages={messages}
|
||||
timeZone={TIMEZONE}
|
||||
now={new Date()}
|
||||
>
|
||||
{children}
|
||||
</NextIntlClientProvider>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user