diff options
author | Paul Frazee <pfrazee@gmail.com> | 2024-07-03 19:05:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-04 03:05:19 +0100 |
commit | 0ed99b840d8de13465f010a6434dea50c72b3f62 (patch) | |
tree | 75ebec28653a081793ca0cbca0c428a816980c6a /src/components/FeedInterstitials.tsx | |
parent | aa7117edb60711a67464f7559118334185f01680 (diff) | |
download | voidsky-0ed99b840d8de13465f010a6434dea50c72b3f62.tar.zst |
New user progress guides (#4716)
* Add the animated checkmark svg * Add progress guide list and task components * Add ProgressGuide Toast component * Implement progress-guide controller * Add 7 follows to the progress guide * Wire up action captures * Wire up progress-guide persistence * Trigger progress guide on account creation * Clear the progress guide from storage on complete * Add progress guide interstitial, put behind gate * Fix: read progress guide state from prefs * Some defensive type checks * Create separate toast for completion * List tweaks * Only show on Discover * Spacing and progress tweaks * Completely hide when complete * Capture the progress guide in local state, and only render toasts while guide is active * Fix: ensure persisted hydrates into local state * Gate --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
Diffstat (limited to 'src/components/FeedInterstitials.tsx')
-rw-r--r-- | src/components/FeedInterstitials.tsx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/components/FeedInterstitials.tsx b/src/components/FeedInterstitials.tsx index 00342b39f..ca3b085b9 100644 --- a/src/components/FeedInterstitials.tsx +++ b/src/components/FeedInterstitials.tsx @@ -6,11 +6,13 @@ import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useNavigation} from '@react-navigation/native' +import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' import {NavigationProp} from '#/lib/routes/types' import {logEvent} from '#/lib/statsig/statsig' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {useGetPopularFeedsQuery} from '#/state/queries/feed' import {useSuggestedFollowsQuery} from '#/state/queries/suggested-follows' +import {useProgressGuide} from '#/state/shell/progress-guide' import {atoms as a, useBreakpoints, useTheme, ViewStyleProp, web} from '#/alf' import {Button} from '#/components/Button' import * as FeedCard from '#/components/FeedCard' @@ -20,6 +22,7 @@ import {PersonPlus_Stroke2_Corner0_Rounded as Person} from '#/components/icons/P import {InlineLinkText} from '#/components/Link' import * as ProfileCard from '#/components/ProfileCard' import {Text} from '#/components/Typography' +import {ProgressGuideList} from './ProgressGuide/List' function CardOuter({ children, @@ -352,3 +355,26 @@ export function SuggestedFeeds() { </View> ) } + +export function ProgressGuide() { + const t = useTheme() + const {isDesktop} = useWebMediaQueries() + const guide = useProgressGuide('like-10-and-follow-7') + + if (isDesktop) { + return null + } + + return guide ? ( + <View + style={[ + a.border_t, + t.atoms.border_contrast_low, + a.px_lg, + a.py_lg, + a.pb_lg, + ]}> + <ProgressGuideList /> + </View> + ) : null +} |