From 15718d8d2bb310dc9adfd4f0bbcaca3d167e6cab Mon Sep 17 00:00:00 2001 From: Lee Hansel Solevilla <13744167+sshanzel@users.noreply.github.com> Date: Wed, 27 Nov 2024 22:45:21 +0800 Subject: [PATCH] chore: cleanup seniority based categories (#3877) --- packages/shared/src/lib/featureManagement.ts | 1 - packages/webapp/pages/onboarding.tsx | 33 -------------------- 2 files changed, 34 deletions(-) diff --git a/packages/shared/src/lib/featureManagement.ts b/packages/shared/src/lib/featureManagement.ts index c2d177359e..de29e567d3 100644 --- a/packages/shared/src/lib/featureManagement.ts +++ b/packages/shared/src/lib/featureManagement.ts @@ -30,7 +30,6 @@ const feature = { showRoadmap: new Feature('show_roadmap', true), onboardingChecklist: new Feature('onboarding_checklist', true), showCodeSnippets: new Feature('show_code_snippets', false), - seniorContentOnboarding: new Feature('senior_content_onboarding', false), postBannerExtensionPrompt: new Feature('post_banner_extension_prompt', false), plusSubscription: new Feature('plus_subscription', false), feedPageSizes: new Feature('feed_page_sizes', { diff --git a/packages/webapp/pages/onboarding.tsx b/packages/webapp/pages/onboarding.tsx index 5c8fddb869..316e2f7d86 100644 --- a/packages/webapp/pages/onboarding.tsx +++ b/packages/webapp/pages/onboarding.tsx @@ -32,7 +32,6 @@ import { NextSeoProps } from 'next-seo'; import { SIGNIN_METHOD_KEY } from '@dailydotdev/shared/src/hooks/auth/useSignBack'; import { useFeature, - useFeaturesReadyContext, useGrowthBookContext, } from '@dailydotdev/shared/src/components/GrowthBookProvider'; import SignupDisclaimer from '@dailydotdev/shared/src/components/auth/SignupDisclaimer'; @@ -42,7 +41,6 @@ import { } from '@dailydotdev/shared/src/components'; import useFeedSettings from '@dailydotdev/shared/src/hooks/useFeedSettings'; import { - EXPERIENCE_TO_SENIORITY, logPixelSignUp, Pixels, } from '@dailydotdev/shared/src/components/Pixels'; @@ -62,7 +60,6 @@ import { useSettingsContext } from '@dailydotdev/shared/src/contexts/SettingsCon import { ChecklistViewState } from '@dailydotdev/shared/src/lib/checklist'; import { getPathnameWithQuery } from '@dailydotdev/shared/src/lib'; import { webappUrl } from '@dailydotdev/shared/src/lib/constants'; -import useMutateFilters from '@dailydotdev/shared/src/hooks/useMutateFilters'; import dynamic from 'next/dynamic'; import { usePushNotificationContext } from '@dailydotdev/shared/src/contexts/PushNotificationContext'; import { defaultOpenGraph, defaultSeo } from '../next-seo'; @@ -109,7 +106,6 @@ const seo: NextSeoProps = { export function OnboardPage(): ReactElement { const router = useRouter(); - const { getFeatureValue } = useFeaturesReadyContext(); const { setSettings } = useSettingsContext(); const isLogged = useRef(false); const { user, isAuthReady, anonymous } = useAuthContext(); @@ -141,34 +137,14 @@ export function OnboardPage(): ReactElement { const targetId: string = ExperimentWinner.OnboardingV4; const formRef = useRef(); const [activeScreen, setActiveScreen] = useState(OnboardingStep.Intro); - const { updateAdvancedSettings } = useMutateFilters(user); const [shouldEnrollSourceSelection, setShouldEnrollSourceSelection] = useState(false); const { value: showOnboardingSources } = useConditionalFeature({ feature: featureOnboardingSources, shouldEvaluate: shouldEnrollSourceSelection, }); - const isSeniorUser = - EXPERIENCE_TO_SENIORITY[user?.experienceLevel] === 'senior' || - user?.experienceLevel === 'MORE_THAN_4_YEARS'; - - const isFeedSettingsDefined = useMemo(() => !!feedSettings, [feedSettings]); const hasSelectTopics = !!feedSettings?.includeTags?.length; - const updateSettingsBasedOnExperience = useCallback(() => { - const LISTICLE_ADVANCED_SETTINGS_ID = 10; - const MEMES_ADVANCED_SETTINGS_ID = 5; - - if (isSeniorUser && isFeedSettingsDefined) { - updateAdvancedSettings({ - advancedSettings: [ - { id: MEMES_ADVANCED_SETTINGS_ID, enabled: false }, - { id: LISTICLE_ADVANCED_SETTINGS_ID, enabled: false }, - ], - }); - } - }, [isSeniorUser, isFeedSettingsDefined, updateAdvancedSettings]); - useEffect(() => { if (!isPageReady || isLogged.current) { return; @@ -195,15 +171,6 @@ export function OnboardPage(): ReactElement { } if (activeScreen === OnboardingStep.EditTag) { - if (isSeniorUser) { - const seniorContentOnboarding = getFeatureValue( - feature.seniorContentOnboarding, - ); - if (seniorContentOnboarding) { - updateSettingsBasedOnExperience(); - } - } - setShouldEnrollSourceSelection(true); return setActiveScreen(OnboardingStep.ContentTypes); }