Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(clerk-js): Update ui of OrganizationSwitcher to better match OrganizationList #1675

Merged
merged 5 commits into from
Sep 5, 2023
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
7 changes: 7 additions & 0 deletions .changeset/popular-sloths-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@clerk/localizations': patch
'@clerk/clerk-js': patch
'@clerk/types': patch
---

Organization Switcher now diplays organization invitations and suggestions in a more compact form.
31 changes: 31 additions & 0 deletions packages/clerk-js/src/ui/common/InfiniteListSpinner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { forwardRef } from 'react';

import { Box, Spinner } from '../customizables';

export const InfiniteListSpinner = forwardRef<HTMLDivElement>((_, ref) => {
return (
<Box
ref={ref}
sx={t => ({
width: '100%',
height: t.space.$12,
position: 'relative',
})}
>
<Box
sx={{
margin: 'auto',
position: 'absolute',
left: '50%',
top: '50%',
transform: 'translateY(-50%) translateX(-50%)',
}}
>
<Spinner
size='md'
colorScheme='primary'
/>
</Box>
</Box>
);
});
1 change: 1 addition & 0 deletions packages/clerk-js/src/ui/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export * from './BlockButtons';
export * from './constants';
export * from './CalloutWithAction';
export * from './forms';
export * from './InfiniteListSpinner';
export * from './redirects';
export * from './verification';
export * from './withRedirectToHome';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import { Plus } from '../../../ui/icons';
import { useCoreUser } from '../../contexts';
import { descriptors, localizationKeys } from '../../customizables';
import { Action, SecondaryActions } from '../../elements';
import { UserInvitationList } from './UserInvitationList';
import { UserInvitationSuggestionList } from './UserInvitationSuggestionList';
import type { UserMembershipListProps } from './UserMembershipList';
import { UserMembershipList } from './UserMembershipList';
import { UserSuggestionList } from './UserSuggestionList';

export interface OrganizationActionListProps extends UserMembershipListProps {
onCreateOrganizationClick: React.MouseEventHandler;
Expand Down Expand Up @@ -43,11 +42,12 @@ export const OrganizationActionList = (props: OrganizationActionListProps) => {
const { onCreateOrganizationClick, onPersonalWorkspaceClick, onOrganizationClick } = props;

return (
<SecondaryActions elementDescriptor={descriptors.organizationSwitcherPopoverActions}>
<UserMembershipList {...{ onPersonalWorkspaceClick, onOrganizationClick }} />
<UserInvitationList />
<UserSuggestionList />
<CreateOrganizationButton {...{ onCreateOrganizationClick }} />
</SecondaryActions>
<>
<UserInvitationSuggestionList />
<SecondaryActions elementDescriptor={descriptors.organizationSwitcherPopoverActions}>
<UserMembershipList {...{ onPersonalWorkspaceClick, onOrganizationClick }} />
<CreateOrganizationButton {...{ onCreateOrganizationClick }} />
</SecondaryActions>
</>
);
};

This file was deleted.

Loading