fix: Button resizing in horizontal filter bar (#22365)

This commit is contained in:
Michael S. Molina 2022-12-08 13:38:56 -05:00 committed by GitHub
parent de4f50909e
commit 3a442e09bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -28,8 +28,8 @@ export interface BadgeProps extends AntdBadgeProps {
const Badge = styled(
(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
{ textColor, ...props }: BadgeProps,
) => <AntdBadge {...props} />,
{ textColor, color, text, ...props }: BadgeProps,
) => <AntdBadge text={text} color={text ? color : undefined} {...props} />,
)`
& > sup {
padding: 0 ${({ theme }) => theme.gridUnit * 2}px;

View File

@ -376,10 +376,14 @@ const DropdownContainer = forwardRef(
{dropdownTriggerText}
<Badge
count={dropdownTriggerCount ?? overflowingCount}
color={
(dropdownTriggerCount ?? overflowingCount) > 0
? theme.colors.primary.base
: theme.colors.grayscale.light1
}
showZero
css={css`
margin-left: ${dropdownTriggerCount ?? overflowingCount
? `${theme.gridUnit * 2}px`
: '0'};
margin-left: ${theme.gridUnit * 2}px;
`}
/>
<Icons.DownOutlined