Skip to content

Commit

Permalink
feat(clerk-js,types): Add id's to the organizationPreview descriptor …
Browse files Browse the repository at this point in the history
…to allow better customization
  • Loading branch information
octoper committed Nov 20, 2023
1 parent 52ff8fe commit 906ef54
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const OrganizationSwitcherPopover = React.forwardRef<HTMLDivElement, Orga
{currentOrg ? (
<>
<OrganizationPreview
elementId={'organizationSwitcher'}
elementId={'organizationSwitcherActiveOrganization'}
gap={4}
organization={currentOrg}
user={user}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const OrganizationSwitcherTrigger = withAvatarShimmer(
>
{organization && (
<OrganizationPreview
elementId={'organizationSwitcher'}
elementId={'organizationSwitcherTrigger'}
gap={3}
size={'sm'}
organization={organization}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const InvitationPreview = withCardStateProvider(
})}
>
<OrganizationPreview
elementId='organizationSwitcher'
elementId='organizationSwitcherTrigger'
avatarSx={t => ({ margin: `0 calc(${t.space.$3}/2)` })}
organization={publicOrganizationData}
size='sm'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const UserMembershipList = (props: UserMembershipListProps) => {
role='menuitem'
>
<OrganizationPreview
elementId='organizationSwitcher'
elementId='organizationSwitcherListedOrganization'
avatarSx={t => ({ margin: `0 calc(${t.space.$3}/2)` })}
organization={organization}
size='sm'
Expand Down
6 changes: 5 additions & 1 deletion packages/types/src/elementIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ export type ProfileSectionId =
export type ProfilePageId = 'account' | 'security' | 'organizationSettings' | 'organizationMembers';

export type UserPreviewId = 'userButton' | 'personalWorkspace';
export type OrganizationPreviewId = 'organizationSwitcher' | 'organizationList';
export type OrganizationPreviewId =
| 'organizationSwitcherTrigger'
| 'organizationList'
| 'organizationSwitcherListedOrganization'
| 'organizationSwitcherActiveOrganization';

export type FooterActionId = 'havingTrouble' | 'alternativeMethods' | 'signUp' | 'signIn';

Expand Down

0 comments on commit 906ef54

Please sign in to comment.