diff --git a/package.json b/package.json index cd8e279..dc62577 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "predev": "yarn generate-theme-typings", "prebuild": "yarn generate-theme-typings", "prepare": "husky install", - "dev": "next dev", + "dev": "next dev -p 3001", "build": "next build", "start": "next start", "lint": "next lint", diff --git a/public/favicons/favicon-16x16.png b/public/favicons/favicon-16x16.png deleted file mode 100644 index 34d9ac4..0000000 Binary files a/public/favicons/favicon-16x16.png and /dev/null differ diff --git a/public/favicons/favicon-32x32.png b/public/favicons/favicon-32x32.png deleted file mode 100644 index f7a1f11..0000000 Binary files a/public/favicons/favicon-32x32.png and /dev/null differ diff --git a/public/favicons/favicon.ico b/public/favicons/favicon.ico index e31bddd..85ab261 100644 Binary files a/public/favicons/favicon.ico and b/public/favicons/favicon.ico differ diff --git a/public/favicons/mstile-150x150.png b/public/favicons/mstile-150x150.png deleted file mode 100644 index fbefcb6..0000000 Binary files a/public/favicons/mstile-150x150.png and /dev/null differ diff --git a/src/components/features/hero-banner/HeroBanner.tsx b/src/components/features/hero-banner/HeroBanner.tsx index 864fdfc..a4799e7 100644 --- a/src/components/features/hero-banner/HeroBanner.tsx +++ b/src/components/features/hero-banner/HeroBanner.tsx @@ -28,17 +28,11 @@ export const HeroBanner = ({ sys: { id: entryId }, }: PageLandingFieldsFragment) => { const inspectorProps = useContentfulInspectorMode({ entryId }); - const { demoExperimentMode, experimentVariant } = useContext(ExperimentContext); + const { demoExperimentMode, experimentVariant, userId } = useContext(ExperimentContext); const [hero, setHero] = useState(null); useEffect(() => { const matchExperimentData = async () => { - const userId = demoExperimentMode - ? experimentVariant === 'control' - ? 'heather.lee@amplitude.com' - : 'anotheruser@amplitude.com' - : 'heather.lee@amplitude.com'; - await experiment.fetch({ user_id: userId, }); @@ -54,7 +48,7 @@ export const HeroBanner = ({ } }; matchExperimentData(); - }, [heroBanner, demoExperimentMode, experimentVariant]); + }, [heroBanner, userId]); return ( ({ export const ExperimentProvider = ({ children }: { children: React.ReactElement | React.ReactElement[] }) => { const [demoExperimentMode, setDemoExperimentMode] = useState(false); const [experimentVariant, setExperimentVariant] = useState('control'); + + const userId = useMemo(() => { + return demoExperimentMode + ? experimentVariant === 'control' + ? 'control@amplitude.com' + : 'treatment@amplitude.com' + : 'control@amplitude.com'; + }, [demoExperimentMode, experimentVariant]); + return ( - + {children} ); diff --git a/src/components/templates/header/header.tsx b/src/components/templates/header/header.tsx index d179b3f..753e049 100644 --- a/src/components/templates/header/header.tsx +++ b/src/components/templates/header/header.tsx @@ -21,7 +21,7 @@ export const HEADER_HEIGHT = 70; export const Header = (props: BoxProps) => { const { t } = useTranslation(); - const { demoExperimentMode, setDemoExperimentMode, setExperimentVariant } = + const { demoExperimentMode, setDemoExperimentMode, setExperimentVariant, userId } = useContext(ExperimentContext); return ( @@ -85,6 +85,10 @@ export const Header = (props: BoxProps) => { + + + Currently signed in user: {userId} + ); }; diff --git a/src/components/templates/layout/layout.tsx b/src/components/templates/layout/layout.tsx index 07d4f0e..86294dd 100644 --- a/src/components/templates/layout/layout.tsx +++ b/src/components/templates/layout/layout.tsx @@ -12,7 +12,7 @@ interface LayoutPropsInterface { children: ReactNode; } -export const experiment = Experiment.initialize(`${process.env.CONTENTFUL_ACCESS_TOKEN || ''}`, { +export const experiment = Experiment.initialize(process.env.NEXT_PUBLIC_AMPLITUDE_EXPERIMENT_CLIENT_KEY || "", { debug: true, });