Rework modals to support multiple active

This commit is contained in:
Paul Frazee 2023-02-23 17:22:03 -06:00
parent b4f2a6979a
commit 154c34e915
13 changed files with 147 additions and 187 deletions

View file

@ -15,11 +15,7 @@ import {
import {BlurView} from '../util/BlurView'
import {ProfileViewModel} from 'state/models/profile-view'
import {useStores} from 'state/index'
import {
EditProfileModal,
ReportAccountModal,
ProfileImageLightbox,
} from 'state/models/shell-ui'
import {ProfileImageLightbox} from 'state/models/shell-ui'
import {pluralize} from 'lib/strings/helpers'
import {toShareUrl} from 'lib/strings/url-helpers'
import {s, gradients} from 'lib/styles'
@ -65,7 +61,11 @@ export const ProfileHeader = observer(function ProfileHeader({
}
const onPressEditProfile = () => {
track('ProfileHeader:EditProfileButtonClicked')
store.shell.openModal(new EditProfileModal(view, onRefreshAll))
store.shell.openModal({
name: 'edit-profile',
profileView: view,
onUpdate: onRefreshAll,
})
}
const onPressFollowers = () => {
track('ProfileHeader:FollowersButtonClicked')
@ -101,7 +101,10 @@ export const ProfileHeader = observer(function ProfileHeader({
}
const onPressReportAccount = () => {
track('ProfileHeader:ReportAccountButtonClicked')
store.shell.openModal(new ReportAccountModal(view.did))
store.shell.openModal({
name: 'report-account',
did: view.did,
})
}
// loading