mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
wrap in GTM provider
This commit is contained in:
@@ -2,6 +2,7 @@ import { Lato, Noto_Serif_JP } from 'next/font/google';
|
||||
import localFont from 'next/font/local';
|
||||
import { ReactNode, Suspense } from 'react';
|
||||
|
||||
import { GoogleProvider } from 'app/context/google-provider';
|
||||
import { SupportedLocale } from 'components/layout/navbar/language-control';
|
||||
import { NextIntlClientProvider } from 'next-intl';
|
||||
import { notFound } from 'next/navigation';
|
||||
@@ -87,6 +88,8 @@ export default async function RootLayout({
|
||||
notFound();
|
||||
}
|
||||
|
||||
const shouldTrack = process.env.NODE_ENV === 'production';
|
||||
|
||||
return (
|
||||
<html
|
||||
lang={params.locale}
|
||||
@@ -94,9 +97,11 @@ export default async function RootLayout({
|
||||
>
|
||||
<body className="bg-dark text-white selection:bg-green-800 selection:text-green-400">
|
||||
<NextIntlClientProvider locale={params?.locale} messages={messages}>
|
||||
<Suspense>
|
||||
<main>{children}</main>
|
||||
</Suspense>
|
||||
<GoogleProvider isShowing={shouldTrack}>
|
||||
<Suspense>
|
||||
<main>{children}</main>
|
||||
</Suspense>
|
||||
</GoogleProvider>
|
||||
</NextIntlClientProvider>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user