Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/
isExpanded?: boolean;
/** Determines the variant of the notification badge. */
variant?: NotificationBadgeVariant | 'read' | 'unread' | 'attention';
variant?: NotificationBadgeVariant | ButtonProps['variant'] | 'read' | 'unread' | 'attention';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would want to add a different prop, maybe buttonVariant, to pass into the Button variant prop. This prop is a bit confusingly named and should only be for passing to the Button state prop.

We would also need to only pass in anything to the Button state prop only if the button variant is stateful, otherwise the icon coloring on hover/focus gets messed up if the state modifier classes are applied with pf-m-plain.

/** Flag indicating whether the notification badge animation should be triggered. Each
* time this prop is true, the animation will be triggered a single time.
*/
Expand Down Expand Up @@ -80,7 +80,7 @@
variant={ButtonVariant.stateful}
className={buttonClassName}
aria-expanded={isExpanded}
state={variant}

Check failure on line 83 in packages/react-core/src/components/NotificationBadge/NotificationBadge.tsx

View workflow job for this annotation

GitHub Actions / Build, test & deploy

Type '"link" | "warning" | "read" | "primary" | "secondary" | "tertiary" | "danger" | "plain" | "control" | "stateful" | "unread" | "attention" | NotificationBadgeVariant' is not assignable to type '"read" | "unread" | "attention"'.

Check failure on line 83 in packages/react-core/src/components/NotificationBadge/NotificationBadge.tsx

View workflow job for this annotation

GitHub Actions / Build

Type '"link" | "warning" | "read" | "primary" | "secondary" | "tertiary" | "danger" | "plain" | "control" | "stateful" | "unread" | "attention" | NotificationBadgeVariant' is not assignable to type '"read" | "unread" | "attention"'.
isClicked={isExpanded}
icon={notificationIcon}
onAnimationEnd={handleAnimationEnd}
Expand Down
Loading