Skip to content

Commit 6644cc2

Browse files
fix(mosaic): match OrganizationList skeleton to the loaded list (#10608)
1 parent 1832ae5 commit 6644cc2

2 files changed

Lines changed: 37 additions & 16 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/mosaic': patch
3+
---
4+
5+
Fix the `OrganizationList` loading skeleton. Avatar placeholders now match the size of the loaded avatars instead of shrinking to the width of the initials, and the personal account row is shown unless `hidePersonal` is set.

‎packages/mosaic/src/features/organization-list/organization-list.skeleton.tsx‎

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,42 @@ export function OrganizationListSkeleton({
2727
variant='outline'
2828
aria-hidden
2929
>
30+
{hidePersonal ? null : (
31+
<SkeletonRow
32+
name={m.personal}
33+
shape='circle'
34+
/>
35+
)}
3036
{PLACEHOLDER_ORGANIZATIONS.map(name => (
31-
<Item.Root key={name}>
32-
<Item.Media>
33-
<Skeleton>
34-
<RowAvatar
35-
name={name}
36-
shape='square'
37-
size='fit'
38-
/>
39-
</Skeleton>
40-
</Item.Media>
41-
<Item.Content>
42-
<Item.Label>
43-
<Skeleton>{name}</Skeleton>
44-
</Item.Label>
45-
</Item.Content>
46-
</Item.Root>
37+
<SkeletonRow
38+
key={name}
39+
name={name}
40+
shape='square'
41+
/>
4742
))}
4843
</Item.Group>
4944
</Card.Content>
5045
</Card.Root>
5146
);
5247
}
48+
49+
function SkeletonRow({ name, shape }: { name: string; shape: 'circle' | 'square' }) {
50+
return (
51+
<Item.Root>
52+
<Skeleton shape={shape === 'circle' ? 'pill' : 'rounded'}>
53+
<Item.Media>
54+
<RowAvatar
55+
name={name}
56+
shape={shape}
57+
size='fit'
58+
/>
59+
</Item.Media>
60+
</Skeleton>
61+
<Item.Content>
62+
<Item.Label>
63+
<Skeleton>{name}</Skeleton>
64+
</Item.Label>
65+
</Item.Content>
66+
</Item.Root>
67+
);
68+
}

0 commit comments

Comments
 (0)