diff options
author | dan <dan.abramov@gmail.com> | 2024-08-29 18:57:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-29 18:57:36 +0100 |
commit | faf66f3178fbddcfaab9c851b9315f20cd285c38 (patch) | |
tree | f0072c6359184760c232ab7d7371724a0c66f6b1 /src/tours/HomeTour.tsx | |
parent | 69053b1b0add68cc04ce7bc336ed65b2514e207b (diff) | |
download | voidsky-faf66f3178fbddcfaab9c851b9315f20cd285c38.tar.zst |
Remove new_user_guided_tour and tour code (#5023)
Diffstat (limited to 'src/tours/HomeTour.tsx')
-rw-r--r-- | src/tours/HomeTour.tsx | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/src/tours/HomeTour.tsx b/src/tours/HomeTour.tsx deleted file mode 100644 index d938fe0e0..000000000 --- a/src/tours/HomeTour.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import React from 'react' -import {msg} from '@lingui/macro' -import {useLingui} from '@lingui/react' -import { - IStep, - TourGuideZone, - TourGuideZoneByPosition, - useTourGuideController, -} from 'rn-tourguide' - -import {DISCOVER_FEED_URI} from '#/lib/constants' -import {isWeb} from '#/platform/detection' -import {useSetSelectedFeed} from '#/state/shell/selected-feed' -import {TOURS} from '.' -import {useHeaderPosition} from './positioning' - -export function HomeTour() { - const {_} = useLingui() - const {tourKey, eventEmitter} = useTourGuideController(TOURS.HOME) - const setSelectedFeed = useSetSelectedFeed() - const headerPosition = useHeaderPosition() - - React.useEffect(() => { - const handleOnStepChange = (step?: IStep) => { - if (step?.order === 2) { - setSelectedFeed('following') - } else if (step?.order === 3) { - setSelectedFeed(`feedgen|${DISCOVER_FEED_URI}`) - } - } - eventEmitter?.on('stepChange', handleOnStepChange) - return () => { - eventEmitter?.off('stepChange', handleOnStepChange) - } - }, [eventEmitter, setSelectedFeed]) - - return ( - <> - <TourGuideZoneByPosition - isTourGuide - tourKey={tourKey} - zone={1} - top={headerPosition.top} - left={headerPosition.left} - width={headerPosition.width} - height={headerPosition.height} - borderRadiusObject={headerPosition.borderRadiusObject} - text={_(msg`Switch between feeds to control your experience.`)} - /> - <TourGuideZoneByPosition - isTourGuide - tourKey={tourKey} - zone={2} - top={headerPosition.top} - left={headerPosition.left} - width={headerPosition.width} - height={headerPosition.height} - borderRadiusObject={headerPosition.borderRadiusObject} - text={_(msg`Following shows the latest posts from people you follow.`)} - /> - <TourGuideZoneByPosition - isTourGuide - tourKey={tourKey} - zone={3} - top={headerPosition.top} - left={headerPosition.left} - width={headerPosition.width} - height={headerPosition.height} - borderRadiusObject={headerPosition.borderRadiusObject} - text={_(msg`Discover learns which posts you like as you browse.`)} - /> - </> - ) -} - -export function HomeTourExploreWrapper({ - children, -}: React.PropsWithChildren<{}>) { - const {_} = useLingui() - const {tourKey} = useTourGuideController(TOURS.HOME) - return ( - <TourGuideZone - tourKey={tourKey} - zone={4} - tooltipBottomOffset={50} - shape={isWeb ? 'rectangle' : 'circle'} - text={_( - msg`Find more feeds and accounts to follow in the Explore page.`, - )}> - {children} - </TourGuideZone> - ) -} |