From a12686e37f6018dcf67419155a67446eaf24e621 Mon Sep 17 00:00:00 2001 From: Yangshun Tay Date: Thu, 27 Oct 2022 09:35:50 +0800 Subject: [PATCH] [portal] add Google Analytics --- .../portal/src/components/global/AppShell.tsx | 145 +++++++++--------- .../src/components/global/GoogleAnalytics.tsx | 102 ++++++++++++ .../src/components/global/HomeNavigation.ts | 1 + .../src/components/offers/OffersNavigation.ts | 2 + .../questions/QuestionsNavigation.ts | 2 + .../components/resumes/ResumesNavigation.ts | 2 + apps/portal/src/types/index.d.ts | 9 ++ 7 files changed, 193 insertions(+), 70 deletions(-) create mode 100644 apps/portal/src/components/global/GoogleAnalytics.tsx create mode 100644 apps/portal/src/types/index.d.ts diff --git a/apps/portal/src/components/global/AppShell.tsx b/apps/portal/src/components/global/AppShell.tsx index a458a433..20306d7f 100644 --- a/apps/portal/src/components/global/AppShell.tsx +++ b/apps/portal/src/components/global/AppShell.tsx @@ -13,6 +13,7 @@ import OffersNavigation from '~/components/offers/OffersNavigation'; import QuestionsNavigation from '~/components/questions/QuestionsNavigation'; import ResumesNavigation from '~/components/resumes/ResumesNavigation'; +import GoogleAnalytics from './GoogleAnalytics'; import MobileNavigation from './MobileNavigation'; import type { ProductNavigationItems } from './ProductNavigation'; import ProductNavigation from './ProductNavigation'; @@ -106,6 +107,7 @@ export default function AppShell({ children }: Props) { const router = useRouter(); const currentProductNavigation: Readonly<{ + googleAnalyticsMeasurementID: string; navigation: ProductNavigationItems; showGlobalNav: boolean; title: string; @@ -128,84 +130,87 @@ export default function AppShell({ children }: Props) { })(); return ( -
- {/* Narrow sidebar */} - {currentProductNavigation.showGlobalNav && ( -
-
-
- - Tech Interview Handbook - -
-
- {GlobalNavigation.map((item) => ( - -