about summary refs log tree commit diff
path: root/src/view/com/util/UserAvatar.tsx
diff options
context:
space:
mode:
authorAnsh <anshnanda10@gmail.com>2023-03-02 16:53:18 -0800
committerGitHub <noreply@github.com>2023-03-02 18:53:18 -0600
commite592e59f4e339aff48589ba7a6f93209bf31d026 (patch)
tree2568a58d1bac350d45897df843510d7ecd2b1686 /src/view/com/util/UserAvatar.tsx
parentaeb04a2ed0b90091f92fd1130bd3d30a76449cb2 (diff)
downloadvoidsky-e592e59f4e339aff48589ba7a6f93209bf31d026.tar.zst
72-delete-avatar-and-cover (#255)
* allow to delete profile pic

* allow for removing banner
Diffstat (limited to 'src/view/com/util/UserAvatar.tsx')
-rw-r--r--src/view/com/util/UserAvatar.tsx17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/view/com/util/UserAvatar.tsx b/src/view/com/util/UserAvatar.tsx
index 5a7a4801d..d0d2c273b 100644
--- a/src/view/com/util/UserAvatar.tsx
+++ b/src/view/com/util/UserAvatar.tsx
@@ -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 ? (