From 5f48a6efb1fa9fa350892ec1ce7e1868b08a0ef6 Mon Sep 17 00:00:00 2001 From: Alex Carpenter Date: Mon, 24 Apr 2023 11:13:27 -0400 Subject: [PATCH] chore: removes experiment code (#2484) --- components/io-home-hero-alt/index.tsx | 69 +++++---------------------- components/subnav/index.jsx | 19 +------- components/subnav/style.module.css | 15 +----- pages/_app.tsx | 12 ----- 4 files changed, 15 insertions(+), 100 deletions(-) diff --git a/components/io-home-hero-alt/index.tsx b/components/io-home-hero-alt/index.tsx index 8c03080133..3cffb25043 100644 --- a/components/io-home-hero-alt/index.tsx +++ b/components/io-home-hero-alt/index.tsx @@ -1,14 +1,8 @@ import * as React from 'react' -import classNames from 'classnames' -import { useFlagBag } from 'flags/client' import Image from 'next/image' -import { abTestTrack } from 'lib/ab-test-track' import type { Products } from '@hashicorp/platform-product-meta' import type { IntroProps } from '@hashicorp/react-intro/types' -import { isInUS } from '@hashicorp/platform-util/geo' import Intro from '@hashicorp/react-intro' -import Button from '@hashicorp/react-button' -import StandaloneLink from '@hashicorp/react-standalone-link' import s from './style.module.css' interface IoHomeHeroAltProps { @@ -24,10 +18,6 @@ export default function IoHomeHeroAlt({ description, ctas, }: IoHomeHeroAltProps) { - const flagBag = useFlagBag() - const renderVariant = React.useMemo(() => { - return isInUS() && flagBag.settled && flagBag.flags?.tryForFree - }, [flagBag]) return (
@@ -57,54 +47,19 @@ export default function IoHomeHeroAlt({ heading={heading} headingSize={1} description={description} - // Temporary use custom actions implementation for experiement. - // - // actions={{ - // layout: 'stacked', - // theme: brand, - // ctas: ctas.map( - // (cta: { title: string; href: string }, index: number) => { - // return { - // ...cta, - // type: index === 0 ? 'button' : 'standalone-link', - // } - // } - // ) as IntroProps['actions']['ctas'], - // }} + actions={{ + layout: 'stacked', + theme: brand, + ctas: ctas.map( + (cta: { title: string; href: string }, index: number) => { + return { + ...cta, + type: index === 0 ? 'button' : 'standalone-link', + } + } + ) as IntroProps['actions']['ctas'], + }} /> -
- {ctas.map((cta, index) => { - if (index === 0) { - return ( -
diff --git a/components/subnav/index.jsx b/components/subnav/index.jsx index 81381ac631..91b7561377 100644 --- a/components/subnav/index.jsx +++ b/components/subnav/index.jsx @@ -1,21 +1,12 @@ import * as React from 'react' -import classNames from 'classnames' import Subnav from '@hashicorp/react-subnav' -import { isInUS } from '@hashicorp/platform-util/geo' import Link from 'next/link' -import { useFlagBag } from 'flags/client' import s from './style.module.css' export default function DefaultSubnav({ menuItems }) { - const flagBag = useFlagBag() - const renderVariant = React.useMemo(() => { - return isInUS() && flagBag.settled && flagBag.flags?.tryForFree - }, [flagBag]) - const classnames = classNames(s.subnav, flagBag.settled && s.settled) - return ( - abTestTrack({ - type: 'Result', - test_name: 'io-site primary CTA copy test 03-23', - variant: renderVariant ? 'true' : 'false', - }), }, ]} menuItems={menuItems} diff --git a/components/subnav/style.module.css b/components/subnav/style.module.css index cdfe044761..50d8f1a2d0 100644 --- a/components/subnav/style.module.css +++ b/components/subnav/style.module.css @@ -1,14 +1 @@ -.subnav { - & [data-ga-button='try-for-free'], - & [data-ga-button='try-terraform-cloud'] { - color: transparent; - min-width: 184px; - } -} - -.settled { - & [data-ga-button='try-for-free'], - & [data-ga-button='try-terraform-cloud'] { - color: white; - } -} +/* .subnav {} */ diff --git a/pages/_app.tsx b/pages/_app.tsx index 6707465a29..4ca1acdf5c 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,7 +1,6 @@ import './style.css' import '@hashicorp/platform-util/nprogress/style.css' -import { useEffect } from 'react' import NProgress from '@hashicorp/platform-util/nprogress' import createConsentManager from '@hashicorp/react-consent-manager/loader' import localConsentManagerServices from 'lib/consent-manager-services' @@ -22,7 +21,6 @@ import alertBannerData, { ALERT_BANNER_ACTIVE } from 'data/alert-banner' import StandardLayout from 'layouts/standard' import { useFlags } from 'flags/client' import { FlagBagProvider } from 'flags/client' -import { abTestTrack } from 'lib/ab-test-track' NProgress({ Router }) const { ConsentManager } = createConsentManager({ @@ -44,16 +42,6 @@ function App({ Component, pageProps, layoutData }) { const Layout = Component.layout ?? StandardLayout - useEffect(() => { - if (flagBag.settled) { - abTestTrack({ - type: 'Served', - test_name: 'io-site primary CTA copy test 03-23', - variant: flagBag.flags.tryForFree.toString(), - }) - } - }, [flagBag]) - return (