From b027fd4c7f30bc0dc59768ec48153d70c90190ce Mon Sep 17 00:00:00 2001 From: Golden Mac-Eteli <92793710+maceteligolden@users.noreply.github.com> Date: Mon, 30 Oct 2023 10:24:49 +0100 Subject: [PATCH] Update/recaptcha script (#1680) * chore:NEXT_PUBLIC_GA_MEASUREMENT_ID to constants * update:wrapper recaptcha script in conditional * Update _app.tsx --------- Co-authored-by: Ruslan K --- apps/web/app/constants.ts | 1 + apps/web/pages/_app.tsx | 30 ++++++++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/apps/web/app/constants.ts b/apps/web/app/constants.ts index 181e81743..b5ce5190a 100644 --- a/apps/web/app/constants.ts +++ b/apps/web/app/constants.ts @@ -36,6 +36,7 @@ export const INVITE_CALLBACK_URL = process.env.INVITE_CALLBACK_URL; export const INVITE_CALLBACK_PATH = '/auth/passcode'; export const VERIFY_EMAIL_CALLBACK_URL = process.env.VERIFY_EMAIL_CALLBACK_URL; export const VERIFY_EMAIL_CALLBACK_PATH = '/verify-email'; +export const GA_MEASUREMENT_ID = process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID export const SMTP_FROM_ADDRESS = process.env.SMTP_FROM_ADDRESS || 'noreply@ever.team'; export const SMTP_HOST = process.env.SMTP_HOST || ''; diff --git a/apps/web/pages/_app.tsx b/apps/web/pages/_app.tsx index 5e517c059..f92ac1b40 100644 --- a/apps/web/pages/_app.tsx +++ b/apps/web/pages/_app.tsx @@ -1,8 +1,7 @@ /* eslint-disable no-mixed-spaces-and-tabs */ import 'react-loading-skeleton/dist/skeleton.css'; import '../styles/globals.css'; - -import { jitsuConfiguration } from '@app/constants'; +import { GA_MEASUREMENT_ID, RECAPTCHA_SITE_KEY, jitsuConfiguration } from '@app/constants'; import { JitsuProvider } from '@jitsu/jitsu-react'; import { Analytics } from '@vercel/analytics/react'; import { AppState } from 'lib/app/init-state'; @@ -16,20 +15,27 @@ import { SkeletonTheme } from 'react-loading-skeleton'; import { RecoilRoot } from 'recoil'; import { JitsuAnalytics } from '../lib/components/services/jitsu-analytics'; import i18n from '../ni18n.config'; + const MyApp = ({ Component, pageProps }: AppProps) => { const isJitsuEnvsPresent = jitsuConfiguration.host && jitsuConfiguration.writeKey; return ( <> - + + {GA_MEASUREMENT_ID && ( + <> + + + )} +