Skip to content

Commit ca00881

Browse files
fix(clerk-js): Collapse sections after uploading/removing avatars (#7044)
1 parent 911ccbb commit ca00881

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

.changeset/three-zebras-boil.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
Improve avatar upload and removal UX to auto collapse the profile section upon successful save.

packages/clerk-js/src/ui/components/OrganizationProfile/ProfileForm.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export const ProfileForm = withCardStateProvider((props: ProfileFormProps) => {
6363
.setLogo({ file })
6464
.then(() => {
6565
card.setIdle();
66+
onSuccess?.();
6667
})
6768
.catch(err => handleError(err, [], card.setError));
6869
};
@@ -72,6 +73,7 @@ export const ProfileForm = withCardStateProvider((props: ProfileFormProps) => {
7273
.setLogo({ file: null })
7374
.then(() => {
7475
card.setIdle();
76+
onSuccess?.();
7577
})
7678
.catch(err => handleError(err, [], card.setError));
7779
};

packages/clerk-js/src/ui/components/UserProfile/ProfileForm.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export const ProfileForm = withCardStateProvider((props: ProfileFormProps) => {
7474
.setProfileImage({ file })
7575
.then(() => {
7676
card.setIdle();
77+
onSuccess?.();
7778
})
7879
.catch(err => handleError(err, [], card.setError));
7980
};
@@ -83,6 +84,7 @@ export const ProfileForm = withCardStateProvider((props: ProfileFormProps) => {
8384
.setProfileImage({ file: null })
8485
.then(() => {
8586
card.setIdle();
87+
onSuccess?.();
8688
})
8789
.catch(err => handleError(err, [], card.setError));
8890
};

0 commit comments

Comments
 (0)