Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/green-spies-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': patch
---

Fix badge misalignment on members list when title is empty
18 changes: 11 additions & 7 deletions packages/clerk-js/src/ui/elements/UserPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export const UserPreview = (props: UserPreviewProps) => {
const mainIdentifierSize =
mainIdentifierVariant || ({ xs: 'subtitle', sm: 'caption', md: 'subtitle', lg: 'h1' } as const)[size];

const previewTitle = localizedTitle || name || identifier;

return (
<Flex
elementDescriptor={descriptors.userPreview}
Expand Down Expand Up @@ -143,13 +145,15 @@ export const UserPreview = (props: UserPreviewProps) => {
variant={mainIdentifierSize}
sx={[theme => ({ display: 'flex', gap: theme.sizes.$1, alignItems: 'center' }), mainIdentifierSx]}
>
<Text
as='span'
truncate
sx={{ fontWeight: 'inherit' }}
>
{localizedTitle || name || identifier}
</Text>
{previewTitle && (
<Text
as='span'
truncate
sx={{ fontWeight: 'inherit' }}
>
{previewTitle}
</Text>
)}

{badge}
</Text>
Expand Down