mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1import {StyleProp, View, ViewStyle} from 'react-native'
2import {msg, Trans} from '@lingui/macro'
3import {useLingui} from '@lingui/react'
4
5import {
6 useProgressGuide,
7 useProgressGuideControls,
8} from '#/state/shell/progress-guide'
9import {atoms as a, useTheme} from '#/alf'
10import {Button, ButtonIcon} from '#/components/Button'
11import {TimesLarge_Stroke2_Corner0_Rounded as Times} from '#/components/icons/Times'
12import {Text} from '#/components/Typography'
13import {FollowDialog} from './FollowDialog'
14import {ProgressGuideTask} from './Task'
15
16export function ProgressGuideList({style}: {style?: StyleProp<ViewStyle>}) {
17 const t = useTheme()
18 const {_} = useLingui()
19 const followProgressGuide = useProgressGuide('follow-10')
20 const followAndLikeProgressGuide = useProgressGuide('like-10-and-follow-7')
21 const guide = followProgressGuide || followAndLikeProgressGuide
22 const {endProgressGuide} = useProgressGuideControls()
23
24 if (guide) {
25 return (
26 <View style={[a.flex_col, a.gap_md, style]}>
27 <View style={[a.flex_row, a.align_center, a.justify_between]}>
28 <Text
29 style={[
30 t.atoms.text_contrast_medium,
31 a.font_bold,
32 a.text_sm,
33 {textTransform: 'uppercase'},
34 ]}>
35 <Trans>Getting started</Trans>
36 </Text>
37 <Button
38 variant="ghost"
39 size="tiny"
40 color="secondary"
41 shape="round"
42 label={_(msg`Dismiss getting started guide`)}
43 onPress={endProgressGuide}>
44 <ButtonIcon icon={Times} size="sm" />
45 </Button>
46 </View>
47 {guide.guide === 'follow-10' && (
48 <>
49 <ProgressGuideTask
50 current={guide.numFollows + 1}
51 total={10 + 1}
52 title={_(msg`Follow 10 accounts`)}
53 subtitle={_(msg`Bluesky is better with friends!`)}
54 />
55 <FollowDialog guide={guide} />
56 </>
57 )}
58 {guide.guide === 'like-10-and-follow-7' && (
59 <>
60 <ProgressGuideTask
61 current={guide.numLikes + 1}
62 total={10 + 1}
63 title={_(msg`Like 10 posts`)}
64 subtitle={_(msg`Teach our algorithm what you like`)}
65 />
66 <ProgressGuideTask
67 current={guide.numFollows + 1}
68 total={7 + 1}
69 title={_(msg`Follow 7 accounts`)}
70 subtitle={_(msg`Bluesky is better with friends!`)}
71 />
72 </>
73 )}
74 </View>
75 )
76 }
77 return null
78}