fix: don't open user profile when clicking edit button in user list (#8831)
This commit is contained in:
committed by
GitHub
parent
bfcdb83536
commit
485f7ee95b
@@ -1,5 +1,11 @@
|
|||||||
import React, {useCallback} from 'react'
|
import React, {useCallback} from 'react'
|
||||||
import {Dimensions, type StyleProp, View, type ViewStyle} from 'react-native'
|
import {
|
||||||
|
Dimensions,
|
||||||
|
type GestureResponderEvent,
|
||||||
|
type StyleProp,
|
||||||
|
View,
|
||||||
|
type ViewStyle,
|
||||||
|
} from 'react-native'
|
||||||
import {type AppBskyGraphDefs} from '@atproto/api'
|
import {type AppBskyGraphDefs} from '@atproto/api'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
@@ -119,7 +125,8 @@ export function ListMembers({
|
|||||||
}, [fetchNextPage])
|
}, [fetchNextPage])
|
||||||
|
|
||||||
const onPressEditMembership = React.useCallback(
|
const onPressEditMembership = React.useCallback(
|
||||||
(profile: bsky.profile.AnyProfileView) => {
|
(e: GestureResponderEvent, profile: bsky.profile.AnyProfileView) => {
|
||||||
|
e.preventDefault()
|
||||||
openModal({
|
openModal({
|
||||||
name: 'user-add-remove-lists',
|
name: 'user-add-remove-lists',
|
||||||
subject: profile.did,
|
subject: profile.did,
|
||||||
@@ -178,7 +185,7 @@ export function ListMembers({
|
|||||||
<Button
|
<Button
|
||||||
testID={`user-${profile.handle}-editBtn`}
|
testID={`user-${profile.handle}-editBtn`}
|
||||||
label={_(msg({message: 'Edit', context: 'action'}))}
|
label={_(msg({message: 'Edit', context: 'action'}))}
|
||||||
onPress={() => onPressEditMembership(profile)}
|
onPress={e => onPressEditMembership(e, profile)}
|
||||||
size="small"
|
size="small"
|
||||||
variant="solid"
|
variant="solid"
|
||||||
color="secondary">
|
color="secondary">
|
||||||
|
|||||||
Reference in New Issue
Block a user