tweaks
This commit is contained in:
@@ -11,8 +11,6 @@ import {useLingui} from '@lingui/react'
|
||||
import {NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||
|
||||
import {CommonNavigatorParams} from 'lib/routes/types'
|
||||
import {useResolveDidQuery} from 'state/queries/resolve-uri'
|
||||
import {useStarterPackQuery} from 'state/queries/useStarterPackQuery'
|
||||
import {useSetMinimalShellMode} from 'state/shell'
|
||||
import {FeedSourceCard} from 'view/com/feeds/FeedSourceCard'
|
||||
import {UserAvatar} from 'view/com/util/UserAvatar'
|
||||
@@ -21,26 +19,119 @@ import {Logo} from 'view/icons/Logo'
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
import {Button, ButtonText} from '#/components/Button'
|
||||
import {Divider} from '#/components/Divider'
|
||||
import {ListMaybePlaceholder} from '#/components/Lists'
|
||||
import {Text} from '#/components/Typography'
|
||||
|
||||
const mockSP = {
|
||||
uri: 'at://did:plc:t5nrviyjxkdhd5ymyra772dm/app.bsky.graph.starterpack/3kuec35ms422t',
|
||||
cid: 'bafyreigrvmj3qd4urr5q6lqku7uzj4xmazepik6oobuxtvunx3g7d6e6xi',
|
||||
record: {
|
||||
list: 'at://did:plc:t5nrviyjxkdhd5ymyra772dm/app.bsky.graph.list/3kuec35kvkj2t',
|
||||
name: 'Bluesky Team',
|
||||
$type: 'app.bsky.graph.starterpack',
|
||||
feeds: [
|
||||
{
|
||||
uri: 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/bsky-team',
|
||||
},
|
||||
{
|
||||
uri: 'at://did:plc:oio4hkxaop4ao4wz2pp3f4cr/app.bsky.feed.generator/atproto',
|
||||
},
|
||||
],
|
||||
createdAt: '2024-06-07T19:43:07.211Z',
|
||||
description:
|
||||
'A starter pack including all the members of the Bluesky Team!',
|
||||
descriptionFacets: [],
|
||||
},
|
||||
creator: {
|
||||
did: 'did:plc:t5nrviyjxkdhd5ymyra772dm',
|
||||
handle: 'haileyok.com',
|
||||
displayName: 'hailey',
|
||||
associated: {
|
||||
chat: {
|
||||
allowIncoming: 'following',
|
||||
},
|
||||
},
|
||||
viewer: {
|
||||
muted: false,
|
||||
blockedBy: false,
|
||||
},
|
||||
labels: [],
|
||||
},
|
||||
feedCount: 0,
|
||||
joinedAllTimeCount: 302,
|
||||
joinedWeekCount: 143,
|
||||
listItemCount: 2,
|
||||
labels: [],
|
||||
indexedAt: '2024-06-07T19:43:07.211Z',
|
||||
feeds: [],
|
||||
list: {
|
||||
uri: 'at://did:plc:oisofpd7lj26yvgiivf3lxsi/app.bsky.graph.list/3kuc6z2xxd22j',
|
||||
cid: 'bafyreibnigtususbzhjzadhsqconcf7s5wan6dl7h6s56jhxd6ebfvflrq',
|
||||
name: 'Bluesky Team',
|
||||
purpose: 'app.bsky.graph.defs#referencelist',
|
||||
indexedAt: '2024-06-07T19:43:07.122Z',
|
||||
labels: [],
|
||||
viewer: {
|
||||
muted: false,
|
||||
},
|
||||
},
|
||||
listItemsSample: [
|
||||
{
|
||||
uri: 'at://did:plc:t5nrviyjxkdhd5ymyra772dm/app.bsky.graph.listitem/3kuec35m2o22t',
|
||||
subject: {
|
||||
did: 'did:plc:5warwwnoavxfhchjhcjlqyqi',
|
||||
handle: 'bob.test',
|
||||
displayName: 'Bob',
|
||||
viewer: {
|
||||
muted: false,
|
||||
blockedBy: false,
|
||||
following:
|
||||
'at://did:plc:t5nrviyjxkdhd5ymyra772dm/app.bsky.graph.follow/3kudwno6ck22t',
|
||||
followedBy:
|
||||
'at://did:plc:5warwwnoavxfhchjhcjlqyqi/app.bsky.graph.follow/3kudwno6nbs2t',
|
||||
},
|
||||
labels: [],
|
||||
description: 'Test user 2',
|
||||
indexedAt: '2024-06-07T16:18:43.414Z',
|
||||
},
|
||||
},
|
||||
{
|
||||
uri: 'at://did:plc:t5nrviyjxkdhd5ymyra772dm/app.bsky.graph.listitem/3kuec35m2nz2t',
|
||||
subject: {
|
||||
did: 'did:plc:cvdwnci2mr5srh4slty7lndz',
|
||||
handle: 'carla.test',
|
||||
displayName: 'Carla',
|
||||
viewer: {
|
||||
muted: false,
|
||||
blockedBy: false,
|
||||
following:
|
||||
'at://did:plc:t5nrviyjxkdhd5ymyra772dm/app.bsky.graph.follow/3kudwno6hgc2t',
|
||||
followedBy:
|
||||
'at://did:plc:cvdwnci2mr5srh4slty7lndz/app.bsky.graph.follow/3kudwno6x2c2t',
|
||||
},
|
||||
labels: [],
|
||||
description: 'Test user 3',
|
||||
indexedAt: '2024-06-07T16:18:43.462Z',
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
export function LandingScreen({
|
||||
navigation,
|
||||
route,
|
||||
}: NativeStackScreenProps<CommonNavigatorParams, 'StarterPackLanding'>) {
|
||||
const {name, rkey} = route.params
|
||||
// const {name, rkey} = route.params
|
||||
const setMinimalShellMode = useSetMinimalShellMode()
|
||||
|
||||
const {
|
||||
data: did,
|
||||
isLoading: isLoadingDid,
|
||||
isError: isErrorDid,
|
||||
} = useResolveDidQuery(name)
|
||||
const {
|
||||
data: starterPack,
|
||||
isLoading: isLoadingStarterPack,
|
||||
isError: isErrorStarterPack,
|
||||
} = useStarterPackQuery({did, rkey})
|
||||
// const {
|
||||
// data: did,
|
||||
// isLoading: isLoadingDid,
|
||||
// isError: isErrorDid,
|
||||
// } = useResolveDidQuery(name)
|
||||
// const {
|
||||
// data: starterPack,
|
||||
// isLoading: isLoadingStarterPack,
|
||||
// isError: isErrorStarterPack,
|
||||
// } = useStarterPackQuery({did, rkey})
|
||||
|
||||
React.useEffect(() => {
|
||||
setMinimalShellMode(true)
|
||||
@@ -49,16 +140,16 @@ export function LandingScreen({
|
||||
}
|
||||
}, [navigation, setMinimalShellMode])
|
||||
|
||||
if (!did || !starterPack) {
|
||||
return (
|
||||
<ListMaybePlaceholder
|
||||
isLoading={isLoadingDid || isLoadingStarterPack}
|
||||
isError={isErrorDid || isErrorStarterPack}
|
||||
/>
|
||||
)
|
||||
}
|
||||
// if (!did || !starterPack) {
|
||||
// return (
|
||||
// <ListMaybePlaceholder
|
||||
// isLoading={isLoadingDid || isLoadingStarterPack}
|
||||
// isError={isErrorDid || isErrorStarterPack}
|
||||
// />
|
||||
// )
|
||||
// }
|
||||
|
||||
return <LandingScreenInner starterPack={starterPack} />
|
||||
return <LandingScreenInner starterPack={mockSP} />
|
||||
}
|
||||
|
||||
function LandingScreenInner({
|
||||
@@ -127,25 +218,20 @@ function LandingScreenInner({
|
||||
{record.description}
|
||||
</Text>
|
||||
<Divider />
|
||||
{!!feeds?.length && (
|
||||
<>
|
||||
<Text style={[a.text_md, t.atoms.text_contrast_medium]}>
|
||||
<Trans>What's in this starter pack?</Trans>
|
||||
</Text>
|
||||
<View
|
||||
style={[
|
||||
t.atoms.bg_contrast_25,
|
||||
a.rounded_sm,
|
||||
{pointerEvents: 'none'},
|
||||
]}>
|
||||
<FeedSourceCard
|
||||
feedUri="at://did:plc:jfhpnnst6flqway4eaeqzj2a/app.bsky.feed.generator/for-science"
|
||||
hideTopBorder={true}
|
||||
/>
|
||||
<FeedSourceCard feedUri="at://did:plc:upmfcx5muayjhkg5sltj625o/app.bsky.feed.generator/aaachrckxlsh2" />
|
||||
</View>
|
||||
</>
|
||||
)}
|
||||
<>
|
||||
<View
|
||||
style={[
|
||||
t.atoms.bg_contrast_25,
|
||||
a.rounded_sm,
|
||||
{pointerEvents: 'none'},
|
||||
]}>
|
||||
<FeedSourceCard
|
||||
feedUri="at://did:plc:jfhpnnst6flqway4eaeqzj2a/app.bsky.feed.generator/for-science"
|
||||
hideTopBorder={true}
|
||||
/>
|
||||
<FeedSourceCard feedUri="at://did:plc:upmfcx5muayjhkg5sltj625o/app.bsky.feed.generator/aaachrckxlsh2" />
|
||||
</View>
|
||||
</>
|
||||
|
||||
{sampleProfiles?.length && (
|
||||
<>
|
||||
|
||||
@@ -896,7 +896,7 @@ export function SettingsScreen({}: Props) {
|
||||
<TouchableOpacity
|
||||
style={[pal.view, styles.linkCardNoIcon]}
|
||||
onPress={() => {
|
||||
navigation.navigate('StarterPack', {
|
||||
navigation.navigate('StarterPackLanding', {
|
||||
name: 'alice.test',
|
||||
rkey: '1234567',
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user