Enhance Providers component with time zone support
- Updated `RootLayout` to retrieve the user's time zone using `getTimeZone` from `next-intl/server`. - Modified the `Providers` component to accept and pass the time zone prop to `NextIntlClientProvider`, improving localization capabilities.
This commit is contained in:
@@ -39,17 +39,23 @@ export function Providers({
|
||||
initialToken,
|
||||
locale,
|
||||
messages,
|
||||
timeZone,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
initialToken?: string | null;
|
||||
locale?: string;
|
||||
messages?: AbstractIntlMessages;
|
||||
timeZone?: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
|
||||
<NextIntlClientProvider locale={locale} messages={messages}>
|
||||
<NextIntlClientProvider
|
||||
locale={locale}
|
||||
messages={messages}
|
||||
timeZone={timeZone}
|
||||
>
|
||||
<ConvexBetterAuthProvider
|
||||
client={convex}
|
||||
authClient={authClient}
|
||||
|
||||
Reference in New Issue
Block a user