make the edit button work
This commit is contained in:
@@ -3,10 +3,11 @@ import {Pressable, View} from 'react-native'
|
|||||||
import {AppBskyGraphDefs, AppBskyGraphStarterpack} from '@atproto/api'
|
import {AppBskyGraphDefs, AppBskyGraphStarterpack} from '@atproto/api'
|
||||||
import {msg, Plural, Trans} from '@lingui/macro'
|
import {msg, Plural, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
import {useNavigation} from '@react-navigation/native'
|
||||||
import {NativeStackScreenProps} from '@react-navigation/native-stack'
|
import {NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||||
|
|
||||||
import {makeProfileLink} from 'lib/routes/links'
|
import {makeProfileLink} from 'lib/routes/links'
|
||||||
import {CommonNavigatorParams} from 'lib/routes/types'
|
import {CommonNavigatorParams, NavigationProp} from 'lib/routes/types'
|
||||||
import {shareUrl} from 'lib/sharing'
|
import {shareUrl} from 'lib/sharing'
|
||||||
import {isWeb} from 'platform/detection'
|
import {isWeb} from 'platform/detection'
|
||||||
import {useResolveDidQuery} from 'state/queries/resolve-uri'
|
import {useResolveDidQuery} from 'state/queries/resolve-uri'
|
||||||
@@ -62,7 +63,9 @@ export function StarterPackScreen({
|
|||||||
<PagerWithHeader
|
<PagerWithHeader
|
||||||
items={items}
|
items={items}
|
||||||
isHeaderReady={true}
|
isHeaderReady={true}
|
||||||
renderHeader={() => <Header starterPack={starterPack} />}>
|
renderHeader={() => (
|
||||||
|
<Header starterPack={starterPack} name={name} rkey={rkey} />
|
||||||
|
)}>
|
||||||
{starterPack.list
|
{starterPack.list
|
||||||
? ({headerHeight, scrollElRef}) => (
|
? ({headerHeight, scrollElRef}) => (
|
||||||
<ProfilesList
|
<ProfilesList
|
||||||
@@ -95,11 +98,16 @@ export function StarterPackScreen({
|
|||||||
|
|
||||||
function Header({
|
function Header({
|
||||||
starterPack,
|
starterPack,
|
||||||
|
name,
|
||||||
|
rkey,
|
||||||
}: {
|
}: {
|
||||||
starterPack: AppBskyGraphDefs.StarterPackView
|
starterPack: AppBskyGraphDefs.StarterPackView
|
||||||
|
name: string
|
||||||
|
rkey: string
|
||||||
}) {
|
}) {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
|
const navigation = useNavigation<NavigationProp>()
|
||||||
const {currentAccount} = useSession()
|
const {currentAccount} = useSession()
|
||||||
const qrCodeDialogControl = useDialogControl()
|
const qrCodeDialogControl = useDialogControl()
|
||||||
|
|
||||||
@@ -174,7 +182,9 @@ function Header({
|
|||||||
variant="solid"
|
variant="solid"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
size="small"
|
size="small"
|
||||||
onPress={() => {}}>
|
onPress={() =>
|
||||||
|
navigation.navigate('StarterPackWizard', {name, rkey})
|
||||||
|
}>
|
||||||
<ButtonText>
|
<ButtonText>
|
||||||
<Trans>Edit</Trans>
|
<Trans>Edit</Trans>
|
||||||
</ButtonText>
|
</ButtonText>
|
||||||
|
|||||||
Reference in New Issue
Block a user