Skip to content

Commit 3410bc6

Browse files
fix(clerk-js): Add missing OrgPreview in OrgSwitcher (#7091)
1 parent 8625042 commit 3410bc6

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.changeset/old-adults-deny.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+
Bring back OrgPreview within the OrgSwitcher component

packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherTrigger.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useOrganization, useOrganizationList, useUser } from '@clerk/shared/react';
22
import { forwardRef } from 'react';
33

4+
import { OrganizationPreview } from '@/ui/elements/OrganizationPreview';
45
import { PersonalWorkspacePreview } from '@/ui/elements/PersonalWorkspacePreview';
56
import { withAvatarShimmer } from '@/ui/elements/withAvatarShimmer';
67

@@ -51,6 +52,16 @@ export const OrganizationSwitcherTrigger = withAvatarShimmer(
5152
aria-haspopup='dialog'
5253
{...rest}
5354
>
55+
{organization && (
56+
<OrganizationPreview
57+
elementId={'organizationSwitcherTrigger'}
58+
gap={3}
59+
size='xs'
60+
organization={organization}
61+
sx={{ maxWidth: '30ch' }}
62+
/>
63+
)}
64+
5465
{!organization && (
5566
<PersonalWorkspacePreview
5667
size='xs'

0 commit comments

Comments
 (0)