Don't show Remove button for nonexistent avatar/banner (#833)

zio/stable
Logan Rosen 2023-06-02 10:51:11 -04:00 committed by GitHub
parent 3217c7ff32
commit 46c9de7c18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -163,7 +163,7 @@ export function UserAvatar({
onSelectNewAvatar?.(croppedImage) onSelectNewAvatar?.(croppedImage)
}, },
}, },
{ !!avatar && {
testID: 'changeAvatarRemoveBtn', testID: 'changeAvatarRemoveBtn',
label: 'Remove', label: 'Remove',
icon: ['far', 'trash-can'] as IconProp, icon: ['far', 'trash-can'] as IconProp,
@ -173,6 +173,7 @@ export function UserAvatar({
}, },
], ],
[ [
avatar,
onSelectNewAvatar, onSelectNewAvatar,
requestCameraAccessIfNeeded, requestCameraAccessIfNeeded,
requestPhotoAccessIfNeeded, requestPhotoAccessIfNeeded,

View File

@ -67,7 +67,7 @@ export function UserBanner({
) )
}, },
}, },
{ !!banner && {
testID: 'changeBannerRemoveBtn', testID: 'changeBannerRemoveBtn',
label: 'Remove', label: 'Remove',
icon: ['far', 'trash-can'] as IconProp, icon: ['far', 'trash-can'] as IconProp,