update nav routes
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {AppBskyGraphStarterpack} from '@atproto/api'
|
import {AppBskyGraphStarterpack, AtUri} from '@atproto/api'
|
||||||
import {StarterPackViewBasic} from '@atproto/api/dist/client/types/app/bsky/graph/defs'
|
import {StarterPackViewBasic} from '@atproto/api/dist/client/types/app/bsky/graph/defs'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
@@ -26,14 +26,19 @@ export function StarterPackCard({
|
|||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {currentAccount} = useSession()
|
const {currentAccount} = useSession()
|
||||||
const {record, creator, joinedAllTimeCount} = starterPack
|
const {uri, record, creator, joinedAllTimeCount} = starterPack
|
||||||
|
const rkey = new AtUri(uri).rkey
|
||||||
|
|
||||||
if (!AppBskyGraphStarterpack.isRecord(record)) {
|
if (!AppBskyGraphStarterpack.isRecord(record)) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link to={{screen: 'StarterPack', params: {id: starterPack.uri}}}>
|
<Link
|
||||||
|
to={{
|
||||||
|
screen: 'StarterPack',
|
||||||
|
params: {name: creator.handle || creator.did, rkey},
|
||||||
|
}}>
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
a.flex_row,
|
a.flex_row,
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export type CommonNavigatorParams = {
|
|||||||
Hashtag: {tag: string; author?: string}
|
Hashtag: {tag: string; author?: string}
|
||||||
MessagesConversation: {conversation: string; embed?: string}
|
MessagesConversation: {conversation: string; embed?: string}
|
||||||
MessagesSettings: undefined
|
MessagesSettings: undefined
|
||||||
StarterPack: {id: string}
|
StarterPack: {name: string; rkey: string}
|
||||||
StarterPackLanding: {id: string}
|
StarterPackLanding: {id: string}
|
||||||
StarterPackWizard: {
|
StarterPackWizard: {
|
||||||
mode: 'Create' | 'Edit'
|
mode: 'Create' | 'Edit'
|
||||||
@@ -104,7 +104,7 @@ export type AllNavigatorParams = CommonNavigatorParams & {
|
|||||||
Hashtag: {tag: string; author?: string}
|
Hashtag: {tag: string; author?: string}
|
||||||
MessagesTab: undefined
|
MessagesTab: undefined
|
||||||
Messages: {animation?: 'push' | 'pop'}
|
Messages: {animation?: 'push' | 'pop'}
|
||||||
StarterPackLanding: {id: string}
|
StarterPack: {name: string; rkey: string}
|
||||||
StarterPackWizard: {
|
StarterPackWizard: {
|
||||||
mode: 'Create' | 'Edit'
|
mode: 'Create' | 'Edit'
|
||||||
id?: string
|
id?: string
|
||||||
|
|||||||
+1
-1
@@ -40,7 +40,7 @@ export const router = new Router({
|
|||||||
Messages: '/messages',
|
Messages: '/messages',
|
||||||
MessagesSettings: '/messages/settings',
|
MessagesSettings: '/messages/settings',
|
||||||
MessagesConversation: '/messages/:conversation',
|
MessagesConversation: '/messages/:conversation',
|
||||||
StarterPack: '/starter-pack/:id',
|
StarterPack: '/starter-pack/:name/:rkey',
|
||||||
StarterPackLanding: '/start/:id',
|
StarterPackLanding: '/start/:id',
|
||||||
StarterPackWizard: '/starter-pack/create',
|
StarterPackWizard: '/starter-pack/create',
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user