-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(clerk-js): Invitation+Suggestion count in OrganizationSwitcherTr…
…igger (#1627) * feat(clerk-js): Add NotificationBadge * chore(clerk-js): Add notification badge descriptor * chore(clerk-js): Show/hide selector icon when notification badge is visible * Revert "chore(clerk-js): Show/hide selector icon when notification badge is visible" This reverts commit a5cbdc923a87bf1adba4fdaccb6335ca2c3587dd. * feat(clerk-js): Notification Badge in OrganizationSwitcher * chore(clerk-js): Add changeset * test(clerk-js): Add a case for the notification counter to appear in OrganizationSwitcher * chore(clerk-js): Abstract badge in orgswitcher to a component
- Loading branch information
1 parent
21d8bee
commit 0a5f632
Showing
11 changed files
with
165 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@clerk/clerk-js': patch | ||
'@clerk/types': patch | ||
--- | ||
|
||
Display a notification counter for organization invitations in OrganizationSwitcher |
8 changes: 1 addition & 7 deletions
8
packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcher.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import type { PropsOfComponent, StyleVariants } from '../styledSystem'; | ||
import { common, createCssVariables, createVariants } from '../styledSystem'; | ||
import { Flex } from './Flex'; | ||
|
||
const vars = createCssVariables('accent', 'bg'); | ||
|
||
const { applyVariants, filterProps } = createVariants(theme => ({ | ||
base: { | ||
color: vars.accent, | ||
backgroundColor: vars.bg, | ||
borderRadius: theme.radii.$sm, | ||
height: theme.space.$4, | ||
minWidth: theme.space.$4, | ||
padding: `${theme.space.$0x5}`, | ||
display: 'inline-flex', | ||
}, | ||
variants: { | ||
textVariant: { ...common.textVariants(theme) }, | ||
colorScheme: { | ||
primary: { | ||
[vars.accent]: theme.colors.$colorTextOnPrimaryBackground, | ||
[vars.bg]: theme.colors.$primary500, | ||
}, | ||
}, | ||
}, | ||
defaultVariants: { | ||
colorScheme: 'primary', | ||
textVariant: 'extraSmallRegular', | ||
}, | ||
})); | ||
|
||
// @ts-ignore | ||
export type NotificationBadgeProps = PropsOfComponent<typeof Flex> & StyleVariants<typeof applyVariants>; | ||
|
||
export const NotificationBadge = (props: NotificationBadgeProps) => { | ||
return ( | ||
<Flex | ||
{...filterProps(props)} | ||
center | ||
as='span' | ||
css={[ | ||
applyVariants(props), | ||
{ | ||
lineHeight: 0, | ||
}, | ||
]} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters