From da17fc6a0028749e69a7473e6990571bc06110df Mon Sep 17 00:00:00 2001 From: Ahmad Abdolsaheb Date: Tue, 15 Aug 2023 13:39:00 +0300 Subject: [PATCH] fix: clean expose_donate_button AB test (#51262) --- .../Header/components/nav-links.tsx | 26 +++++-------------- .../Header/components/universal-nav.tsx | 22 ++-------------- config/misc.ts | 1 - 3 files changed, 8 insertions(+), 41 deletions(-) diff --git a/client/src/components/Header/components/nav-links.tsx b/client/src/components/Header/components/nav-links.tsx index 5cce1544263..bd42e27773b 100644 --- a/client/src/components/Header/components/nav-links.tsx +++ b/client/src/components/Header/components/nav-links.tsx @@ -6,12 +6,9 @@ import { } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import React, { Fragment } from 'react'; -import Media from 'react-responsive'; import { useTranslation, withTranslation } from 'react-i18next'; -import { useFeature } from '@growthbook/growthbook-react'; import { connect } from 'react-redux'; import { radioLocation } from '../../../../../config/env.json'; -import { DONATE_NAV_EXPOSED_WIDTH } from '../../../../../config/misc'; import { openSignoutModal } from '../../../redux/actions'; import { updateMyTheme } from '../../../redux/settings/actions'; import { Link } from '../../helpers'; @@ -67,24 +64,13 @@ const DonateButton = ({ handleMenuKeyDown }: DonateButtonProps) => { const { t } = useTranslation(); - const exposeUniversalDonateButton = useFeature('expose_donate_button').on; if (isUserDonating) return ; - else if (exposeUniversalDonateButton) - return ( - - - - ); - else - return ( - - ); + return ( + + ); }; const toggleTheme = ( diff --git a/client/src/components/Header/components/universal-nav.tsx b/client/src/components/Header/components/universal-nav.tsx index 4fecba9137d..7d9f4a80fc8 100644 --- a/client/src/components/Header/components/universal-nav.tsx +++ b/client/src/components/Header/components/universal-nav.tsx @@ -1,14 +1,10 @@ import Loadable from '@loadable/component'; import React from 'react'; import { useTranslation } from 'react-i18next'; -import Media, { useMediaQuery } from 'react-responsive'; -import { useFeature } from '@growthbook/growthbook-react'; +import { useMediaQuery } from 'react-responsive'; import { isLanding } from '../../../utils/path-parsers'; import { Link, SkeletonSprite } from '../../helpers'; -import { - SEARCH_EXPOSED_WIDTH, - DONATE_NAV_EXPOSED_WIDTH -} from '../../../../../config/misc'; +import { SEARCH_EXPOSED_WIDTH } from '../../../../../config/misc'; import MenuButton from './menu-button'; import NavLinks, { type NavLinksProps } from './nav-links'; import NavLogo from './nav-logo'; @@ -43,8 +39,6 @@ const UniversalNav = ({ query: `(min-width: ${SEARCH_EXPOSED_WIDTH}px)` }); - const exposeDonateButton = useFeature('expose_donate_button').on; - const search = typeof window !== `undefined` && isLanding(window.location.pathname) ? ( @@ -77,18 +71,6 @@ const UniversalNav = ({ ) : ( <> - {!user?.isDonating && exposeDonateButton && ( - - - {t('buttons.donate')} - - - )}