From 2b69e55870d526f8b38f9b0dd158b37cdd146a59 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Fri, 16 Feb 2024 22:23:47 +0000 Subject: [PATCH] Drop following feed settings step --- src/lib/analytics/types.ts | 2 - src/screens/Onboarding/StepFollowingFeed.tsx | 160 ------------------- src/screens/Onboarding/index.tsx | 2 - src/screens/Onboarding/state.ts | 25 ++- 4 files changed, 9 insertions(+), 180 deletions(-) delete mode 100644 src/screens/Onboarding/StepFollowingFeed.tsx diff --git a/src/lib/analytics/types.ts b/src/lib/analytics/types.ts index b4eb0ddcb0..2aa5519e94 100644 --- a/src/lib/analytics/types.ts +++ b/src/lib/analytics/types.ts @@ -133,8 +133,6 @@ export type TrackPropertiesMap = { 'OnboardingV2:StepSuggestedAccounts:End': { selectedAccountsLength: number } - 'OnboardingV2:StepFollowingFeed:Start': {} - 'OnboardingV2:StepFollowingFeed:End': {} 'OnboardingV2:StepAlgoFeeds:Start': {} 'OnboardingV2:StepAlgoFeeds:End': { selectedPrimaryFeeds: string[] diff --git a/src/screens/Onboarding/StepFollowingFeed.tsx b/src/screens/Onboarding/StepFollowingFeed.tsx deleted file mode 100644 index 898afad134..0000000000 --- a/src/screens/Onboarding/StepFollowingFeed.tsx +++ /dev/null @@ -1,160 +0,0 @@ -import React from 'react' -import {View} from 'react-native' -import {useLingui} from '@lingui/react' -import {msg, Trans} from '@lingui/macro' - -import {atoms as a} from '#/alf' -import {ChevronRight_Stroke2_Corner0_Rounded as ChevronRight} from '#/components/icons/Chevron' -import {FilterTimeline_Stroke2_Corner0_Rounded as FilterTimeline} from '#/components/icons/FilterTimeline' -import {Button, ButtonIcon, ButtonText} from '#/components/Button' -import {Text} from '#/components/Typography' -import {Divider} from '#/components/Divider' -import * as Toggle from '#/components/forms/Toggle' -import {useAnalytics} from '#/lib/analytics/analytics' - -import {Context} from '#/screens/Onboarding/state' -import { - Title, - Description, - OnboardingControls, -} from '#/screens/Onboarding/Layout' -import { - usePreferencesQuery, - useSetFeedViewPreferencesMutation, -} from 'state/queries/preferences' -import {IconCircle} from '#/components/IconCircle' - -export function StepFollowingFeed() { - const {_} = useLingui() - const {track} = useAnalytics() - const {dispatch} = React.useContext(Context) - - const {data: preferences} = usePreferencesQuery() - const {mutate: setFeedViewPref, variables} = - useSetFeedViewPreferencesMutation() - - const showReplies = !( - variables?.hideReplies ?? preferences?.feedViewPrefs.hideReplies - ) - const showReposts = !( - variables?.hideReposts ?? preferences?.feedViewPrefs.hideReposts - ) - const showQuotes = !( - variables?.hideQuotePosts ?? preferences?.feedViewPrefs.hideQuotePosts - ) - - const onContinue = React.useCallback(() => { - dispatch({type: 'next'}) - track('OnboardingV2:StepFollowingFeed:End') - }, [track, dispatch]) - - React.useEffect(() => { - track('OnboardingV2:StepFollowingFeed:Start') - }, [track]) - - return ( - // Hack for now to move the image container up - - - - - <Trans>Your default feed is "Following"</Trans> - - - It shows posts from the people you follow as they happen. - - - - { - setFeedViewPref({ - hideReplies: showReplies, - }) - }}> - - - Show replies in Following - - - - - - { - setFeedViewPref({ - hideReposts: showReposts, - }) - }}> - - - Show reposts in Following - - - - - - { - setFeedViewPref({ - hideQuotePosts: showQuotes, - }) - }}> - - - Show quotes in Following - - - - - - - - You can change these settings later. - - - - - - - ) -} diff --git a/src/screens/Onboarding/index.tsx b/src/screens/Onboarding/index.tsx index 9e5029e87a..6b55dcdb39 100644 --- a/src/screens/Onboarding/index.tsx +++ b/src/screens/Onboarding/index.tsx @@ -8,7 +8,6 @@ import {Context, initialState, reducer} from '#/screens/Onboarding/state' import {Layout, OnboardingControls} from '#/screens/Onboarding/Layout' import {StepInterests} from '#/screens/Onboarding/StepInterests' import {StepSuggestedAccounts} from '#/screens/Onboarding/StepSuggestedAccounts' -import {StepFollowingFeed} from '#/screens/Onboarding/StepFollowingFeed' import {StepAlgoFeeds} from '#/screens/Onboarding/StepAlgoFeeds' import {StepTopicalFeeds} from '#/screens/Onboarding/StepTopicalFeeds' import {StepFinished} from '#/screens/Onboarding/StepFinished' @@ -58,7 +57,6 @@ export function Onboarding() { {state.activeStep === 'suggestedAccounts' && ( )} - {state.activeStep === 'followingFeed' && } {state.activeStep === 'algoFeeds' && } {state.activeStep === 'topicalFeeds' && } {state.activeStep === 'moderation' && } diff --git a/src/screens/Onboarding/state.ts b/src/screens/Onboarding/state.ts index bd8205ca2d..e8526a1e22 100644 --- a/src/screens/Onboarding/state.ts +++ b/src/screens/Onboarding/state.ts @@ -8,7 +8,6 @@ export type OnboardingState = { activeStep: | 'interests' | 'suggestedAccounts' - | 'followingFeed' | 'algoFeeds' | 'topicalFeeds' | 'moderation' @@ -70,7 +69,7 @@ export type ApiResponseMap = { export const initialState: OnboardingState = { hasPrev: false, - totalSteps: 7, + totalSteps: 6, activeStep: 'interests', activeStepIndex: 1, @@ -142,20 +141,17 @@ export function reducer( next.activeStep = 'suggestedAccounts' next.activeStepIndex = 2 } else if (s.activeStep === 'suggestedAccounts') { - next.activeStep = 'followingFeed' - next.activeStepIndex = 3 - } else if (s.activeStep === 'followingFeed') { next.activeStep = 'algoFeeds' - next.activeStepIndex = 4 + next.activeStepIndex = 3 } else if (s.activeStep === 'algoFeeds') { next.activeStep = 'topicalFeeds' - next.activeStepIndex = 5 + next.activeStepIndex = 4 } else if (s.activeStep === 'topicalFeeds') { next.activeStep = 'moderation' - next.activeStepIndex = 6 + next.activeStepIndex = 5 } else if (s.activeStep === 'moderation') { next.activeStep = 'finished' - next.activeStepIndex = 7 + next.activeStepIndex = 6 } break } @@ -163,21 +159,18 @@ export function reducer( if (s.activeStep === 'suggestedAccounts') { next.activeStep = 'interests' next.activeStepIndex = 1 - } else if (s.activeStep === 'followingFeed') { + } else if (s.activeStep === 'algoFeeds') { next.activeStep = 'suggestedAccounts' next.activeStepIndex = 2 - } else if (s.activeStep === 'algoFeeds') { - next.activeStep = 'followingFeed' - next.activeStepIndex = 3 } else if (s.activeStep === 'topicalFeeds') { next.activeStep = 'algoFeeds' - next.activeStepIndex = 4 + next.activeStepIndex = 3 } else if (s.activeStep === 'moderation') { next.activeStep = 'topicalFeeds' - next.activeStepIndex = 5 + next.activeStepIndex = 4 } else if (s.activeStep === 'finished') { next.activeStep = 'moderation' - next.activeStepIndex = 6 + next.activeStepIndex = 5 } break }