72-delete-avatar-and-cover (#255)

* allow to delete profile pic

* allow for removing banner
This commit is contained in:
Ansh 2023-03-02 16:53:18 -08:00 committed by GitHub
parent aeb04a2ed0
commit e592e59f4e
4 changed files with 45 additions and 28 deletions

View file

@ -31,7 +31,7 @@ export function UserAvatar({
handle: string
displayName: string | undefined
avatar?: string | null
onSelectNewAvatar?: (img: PickedMedia) => void
onSelectNewAvatar?: (img: PickedMedia | null) => void
}) {
const store = useStores()
const pal = usePalette('default')
@ -97,14 +97,13 @@ export function UserAvatar({
)
},
},
// TODO: Remove avatar https://github.com/bluesky-social/social-app/issues/122
// {
// label: 'Remove',
// icon: ['far', 'trash-can'],
// onPress: () => {
// // Remove avatar API call
// },
// },
{
label: 'Remove',
icon: ['far', 'trash-can'] as IconProp,
onPress: async () => {
onSelectNewAvatar?.(null)
},
},
]
// onSelectNewAvatar is only passed as prop on the EditProfile component
return onSelectNewAvatar ? (

View file

@ -25,7 +25,7 @@ export function UserBanner({
onSelectNewBanner,
}: {
banner?: string | null
onSelectNewBanner?: (img: PickedMedia) => void
onSelectNewBanner?: (img: PickedMedia | null) => void
}) {
const store = useStores()
const pal = usePalette('default')
@ -70,14 +70,13 @@ export function UserBanner({
)
},
},
// TODO: Remove banner https://github.com/bluesky-social/social-app/issues/122
// {
// label: 'Remove',
// icon: ['far', 'trash-can'],
// onPress: () => {
// // Remove banner api call
// },
// },
{
label: 'Remove',
icon: ['far', 'trash-can'] as IconProp,
onPress: () => {
onSelectNewBanner?.(null)
},
},
]
const renderSvg = () => (