diff --git a/.changeset/three-zebras-boil.md b/.changeset/three-zebras-boil.md new file mode 100644 index 00000000000..1f334e42fde --- /dev/null +++ b/.changeset/three-zebras-boil.md @@ -0,0 +1,5 @@ +--- +'@clerk/clerk-js': patch +--- + +Improve avatar upload and removal UX to auto collapse the profile section upon successful save. diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/ProfileForm.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/ProfileForm.tsx index 03f94ae7bf1..a6db3d62456 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/ProfileForm.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/ProfileForm.tsx @@ -63,6 +63,7 @@ export const ProfileForm = withCardStateProvider((props: ProfileFormProps) => { .setLogo({ file }) .then(() => { card.setIdle(); + onSuccess?.(); }) .catch(err => handleError(err, [], card.setError)); }; @@ -72,6 +73,7 @@ export const ProfileForm = withCardStateProvider((props: ProfileFormProps) => { .setLogo({ file: null }) .then(() => { card.setIdle(); + onSuccess?.(); }) .catch(err => handleError(err, [], card.setError)); }; diff --git a/packages/clerk-js/src/ui/components/UserProfile/ProfileForm.tsx b/packages/clerk-js/src/ui/components/UserProfile/ProfileForm.tsx index 6d5d649eed9..245a8f94d20 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/ProfileForm.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/ProfileForm.tsx @@ -74,6 +74,7 @@ export const ProfileForm = withCardStateProvider((props: ProfileFormProps) => { .setProfileImage({ file }) .then(() => { card.setIdle(); + onSuccess?.(); }) .catch(err => handleError(err, [], card.setError)); }; @@ -83,6 +84,7 @@ export const ProfileForm = withCardStateProvider((props: ProfileFormProps) => { .setProfileImage({ file: null }) .then(() => { card.setIdle(); + onSuccess?.(); }) .catch(err => handleError(err, [], card.setError)); };