diff --git a/src/screens/StarterPack/StarterPackLandingScreen.tsx b/src/screens/StarterPack/StarterPackLandingScreen.tsx index c6ba64609f..9b122b820f 100644 --- a/src/screens/StarterPack/StarterPackLandingScreen.tsx +++ b/src/screens/StarterPack/StarterPackLandingScreen.tsx @@ -1,10 +1,6 @@ import React from 'react' import {ScrollView, View} from 'react-native' -import { - AppBskyActorDefs, - AppBskyGraphDefs, - AppBskyGraphStarterpack, -} from '@atproto/api' +import {AppBskyGraphDefs, AppBskyGraphStarterpack} from '@atproto/api' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' @@ -16,7 +12,7 @@ import { import {useResolveDidQuery} from 'state/queries/resolve-uri' import {useStarterPackQuery} from 'state/queries/useStarterPackQuery' import {LoggedOutScreenState} from 'view/com/auth/LoggedOut' -import {UserAvatar} from 'view/com/util/UserAvatar' +import {ProfileCard} from 'view/com/profile/ProfileCard' import {CenteredView} from 'view/com/util/Views' import {Logo} from 'view/icons/Logo' import {atoms as a, useTheme} from '#/alf' @@ -96,11 +92,8 @@ function LandingScreenInner({ const usedStarterPack = useUsedStarterPack() const {isTabletOrDesktop} = useWebMediaQueries() + const listItemsCount = starterPack.list?.listItemCount ?? 0 const sampleProfiles = listItemsSample?.map(item => item.subject) - const userSets = { - first: sampleProfiles?.slice(0, 4), - second: sampleProfiles?.slice(4, 8), - } if (!AppBskyGraphStarterpack.isRecord(record)) { return null @@ -149,7 +142,7 @@ function LandingScreenInner({ ) : null} {joinedWeekCount && joinedWeekCount >= 25 ? ( @@ -208,11 +201,30 @@ function LandingScreenInner({ {feeds?.length ? ( - Also follow these people and many others! + <> + {listItemsCount <= 8 ? ( + Also follow these people right away! + ) : ( + + Also follow these people and {listItemsCount - 8}{' '} + others! + + )} + ) : ( - - Get started by following these people and many others! - + <> + {listItemsCount <= 8 ? ( + + Get started by following these people right away! + + ) : ( + + Get started by following these people and{' '} + {listItemsCount - 8} + others! + + )} + )} - {userSets.first?.length ? ( - - ) : null} - {userSets.second?.length ? ( - - ) : null} + {starterPack.listItemsSample?.map(item => ( + + ))} )} @@ -238,27 +250,3 @@ function LandingScreenInner({ ) } - -function ProfilesSet({ - profiles, -}: { - profiles: AppBskyActorDefs.ProfileViewBasic[] -}) { - const {isTabletOrDesktop} = useWebMediaQueries() - - return ( - - {profiles.map(profile => ( - - - - {profile.displayName} - - - ))} - - ) -}