New Edit Profile dialog on web, use new Edit Image dialog everywhere (#8220)
This commit is contained in:
@@ -12,10 +12,9 @@ import {useLingui} from '@lingui/react'
|
||||
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||
import {logger} from '#/logger'
|
||||
import {isIOS, isWeb} from '#/platform/detection'
|
||||
import {isIOS} from '#/platform/detection'
|
||||
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
||||
import {type Shadow} from '#/state/cache/types'
|
||||
import {useModalControls} from '#/state/modals'
|
||||
import {
|
||||
useProfileBlockMutationQueue,
|
||||
useProfileFollowMutationQueue,
|
||||
@@ -78,19 +77,7 @@ let ProfileHeaderStandard = ({
|
||||
profile.viewer?.blockedBy ||
|
||||
profile.viewer?.blockingByList
|
||||
|
||||
const {openModal} = useModalControls()
|
||||
const editProfileControl = useDialogControl()
|
||||
const onPressEditProfile = React.useCallback(() => {
|
||||
if (isWeb) {
|
||||
// temp, while we figure out the nested dialog bug
|
||||
openModal({
|
||||
name: 'edit-profile',
|
||||
profile,
|
||||
})
|
||||
} else {
|
||||
editProfileControl.open()
|
||||
}
|
||||
}, [editProfileControl, openModal, profile])
|
||||
|
||||
const onPressFollow = () => {
|
||||
requireAuth(async () => {
|
||||
@@ -178,7 +165,7 @@ let ProfileHeaderStandard = ({
|
||||
size="small"
|
||||
color="secondary"
|
||||
variant="solid"
|
||||
onPress={onPressEditProfile}
|
||||
onPress={editProfileControl.open}
|
||||
label={_(msg`Edit profile`)}
|
||||
style={[a.rounded_full]}>
|
||||
<ButtonText>
|
||||
|
||||
Reference in New Issue
Block a user