tweaks
This commit is contained in:
@@ -11,8 +11,6 @@ import {useLingui} from '@lingui/react'
|
|||||||
import {NativeStackScreenProps} from '@react-navigation/native-stack'
|
import {NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||||
|
|
||||||
import {CommonNavigatorParams} from 'lib/routes/types'
|
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 {useSetMinimalShellMode} from 'state/shell'
|
||||||
import {FeedSourceCard} from 'view/com/feeds/FeedSourceCard'
|
import {FeedSourceCard} from 'view/com/feeds/FeedSourceCard'
|
||||||
import {UserAvatar} from 'view/com/util/UserAvatar'
|
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 {atoms as a, useTheme} from '#/alf'
|
||||||
import {Button, ButtonText} from '#/components/Button'
|
import {Button, ButtonText} from '#/components/Button'
|
||||||
import {Divider} from '#/components/Divider'
|
import {Divider} from '#/components/Divider'
|
||||||
import {ListMaybePlaceholder} from '#/components/Lists'
|
|
||||||
import {Text} from '#/components/Typography'
|
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({
|
export function LandingScreen({
|
||||||
navigation,
|
navigation,
|
||||||
route,
|
|
||||||
}: NativeStackScreenProps<CommonNavigatorParams, 'StarterPackLanding'>) {
|
}: NativeStackScreenProps<CommonNavigatorParams, 'StarterPackLanding'>) {
|
||||||
const {name, rkey} = route.params
|
// const {name, rkey} = route.params
|
||||||
const setMinimalShellMode = useSetMinimalShellMode()
|
const setMinimalShellMode = useSetMinimalShellMode()
|
||||||
|
|
||||||
const {
|
// const {
|
||||||
data: did,
|
// data: did,
|
||||||
isLoading: isLoadingDid,
|
// isLoading: isLoadingDid,
|
||||||
isError: isErrorDid,
|
// isError: isErrorDid,
|
||||||
} = useResolveDidQuery(name)
|
// } = useResolveDidQuery(name)
|
||||||
const {
|
// const {
|
||||||
data: starterPack,
|
// data: starterPack,
|
||||||
isLoading: isLoadingStarterPack,
|
// isLoading: isLoadingStarterPack,
|
||||||
isError: isErrorStarterPack,
|
// isError: isErrorStarterPack,
|
||||||
} = useStarterPackQuery({did, rkey})
|
// } = useStarterPackQuery({did, rkey})
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
setMinimalShellMode(true)
|
setMinimalShellMode(true)
|
||||||
@@ -49,16 +140,16 @@ export function LandingScreen({
|
|||||||
}
|
}
|
||||||
}, [navigation, setMinimalShellMode])
|
}, [navigation, setMinimalShellMode])
|
||||||
|
|
||||||
if (!did || !starterPack) {
|
// if (!did || !starterPack) {
|
||||||
return (
|
// return (
|
||||||
<ListMaybePlaceholder
|
// <ListMaybePlaceholder
|
||||||
isLoading={isLoadingDid || isLoadingStarterPack}
|
// isLoading={isLoadingDid || isLoadingStarterPack}
|
||||||
isError={isErrorDid || isErrorStarterPack}
|
// isError={isErrorDid || isErrorStarterPack}
|
||||||
/>
|
// />
|
||||||
)
|
// )
|
||||||
}
|
// }
|
||||||
|
|
||||||
return <LandingScreenInner starterPack={starterPack} />
|
return <LandingScreenInner starterPack={mockSP} />
|
||||||
}
|
}
|
||||||
|
|
||||||
function LandingScreenInner({
|
function LandingScreenInner({
|
||||||
@@ -127,25 +218,20 @@ function LandingScreenInner({
|
|||||||
{record.description}
|
{record.description}
|
||||||
</Text>
|
</Text>
|
||||||
<Divider />
|
<Divider />
|
||||||
{!!feeds?.length && (
|
<>
|
||||||
<>
|
<View
|
||||||
<Text style={[a.text_md, t.atoms.text_contrast_medium]}>
|
style={[
|
||||||
<Trans>What's in this starter pack?</Trans>
|
t.atoms.bg_contrast_25,
|
||||||
</Text>
|
a.rounded_sm,
|
||||||
<View
|
{pointerEvents: 'none'},
|
||||||
style={[
|
]}>
|
||||||
t.atoms.bg_contrast_25,
|
<FeedSourceCard
|
||||||
a.rounded_sm,
|
feedUri="at://did:plc:jfhpnnst6flqway4eaeqzj2a/app.bsky.feed.generator/for-science"
|
||||||
{pointerEvents: 'none'},
|
hideTopBorder={true}
|
||||||
]}>
|
/>
|
||||||
<FeedSourceCard
|
<FeedSourceCard feedUri="at://did:plc:upmfcx5muayjhkg5sltj625o/app.bsky.feed.generator/aaachrckxlsh2" />
|
||||||
feedUri="at://did:plc:jfhpnnst6flqway4eaeqzj2a/app.bsky.feed.generator/for-science"
|
</View>
|
||||||
hideTopBorder={true}
|
</>
|
||||||
/>
|
|
||||||
<FeedSourceCard feedUri="at://did:plc:upmfcx5muayjhkg5sltj625o/app.bsky.feed.generator/aaachrckxlsh2" />
|
|
||||||
</View>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{sampleProfiles?.length && (
|
{sampleProfiles?.length && (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -896,7 +896,7 @@ export function SettingsScreen({}: Props) {
|
|||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={[pal.view, styles.linkCardNoIcon]}
|
style={[pal.view, styles.linkCardNoIcon]}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
navigation.navigate('StarterPack', {
|
navigation.navigate('StarterPackLanding', {
|
||||||
name: 'alice.test',
|
name: 'alice.test',
|
||||||
rkey: '1234567',
|
rkey: '1234567',
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user