fix(layout): restore original structure, keep only Rybbit direct URL fix
Some checks failed
Build and Deploy / build (push) Has been cancelled
Some checks failed
Build and Deploy / build (push) Has been cancelled
Revert unintended changes from previous commit: - Restore AnalyticsProvider (was accidentally removed) - Remove ExitIntentDetector (feature branch code) - Remove Mautic tracking script (feature branch code) Keep only the intended Rybbit fix: - Direct connection to Rybbit instead of server-side proxy
This commit is contained in:
@@ -3,7 +3,7 @@ import { NextIntlClientProvider } from "next-intl";
|
||||
import { getMessages, setRequestLocale } from "next-intl/server";
|
||||
import { SUPPORTED_LOCALES, DEFAULT_LOCALE, isValidLocale } from "@/lib/i18n/locales";
|
||||
import Script from "next/script";
|
||||
import ExitIntentDetector from "@/components/home/ExitIntentDetector";
|
||||
import AnalyticsProvider from "@/components/providers/AnalyticsProvider";
|
||||
|
||||
const RYBBIT_SITE_ID = process.env.NEXT_PUBLIC_RYBBIT_SITE_ID || "1";
|
||||
const RYBBIT_HOST = process.env.NEXT_PUBLIC_RYBBIT_HOST || "https://rybbit.nodecrew.me";
|
||||
@@ -21,7 +21,7 @@ export async function generateMetadata({
|
||||
}): Promise<Metadata> {
|
||||
const { locale } = await params;
|
||||
const validLocale = isValidLocale(locale) ? locale : DEFAULT_LOCALE;
|
||||
const localePrefix = validLocale === DEFAULT_LOCALE ? "" : `/${validLocale}`;
|
||||
const localePrefix = validLocale === DEFAULT_LOCALE ? "" : `/${locale}`;
|
||||
|
||||
const languages: Record<string, string> = {};
|
||||
for (const loc of SUPPORTED_LOCALES) {
|
||||
@@ -50,27 +50,14 @@ export default async function LocaleLayout({
|
||||
|
||||
return (
|
||||
<>
|
||||
<AnalyticsProvider clientId={process.env.NEXT_PUBLIC_OPENPANEL_CLIENT_ID || ""} />
|
||||
<Script
|
||||
src={`${RYBBIT_HOST}/api/script.js`}
|
||||
data-site-id={RYBBIT_SITE_ID}
|
||||
strategy="afterInteractive"
|
||||
/>
|
||||
<Script
|
||||
id="mautic-tracking"
|
||||
strategy="afterInteractive"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
(function(w,d,t,u,n,a,m){w['MauticTrackingObject']=n;
|
||||
w[n]=w[n]||function(){(w[n].q=w[n].q||[]).push(arguments)},a=d.createElement(t),
|
||||
m=d.getElementsByTagName(t)[0];a.async=1;a.src=u;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://mautic.nodecrew.me/mtc.js','mt');
|
||||
mt('send', 'pageview');
|
||||
`,
|
||||
}}
|
||||
/>
|
||||
<NextIntlClientProvider messages={messages}>
|
||||
{children}
|
||||
<ExitIntentDetector />
|
||||
</NextIntlClientProvider>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user