Skip to content

Commit

Permalink
Merge pull request #175 from ClickHouse/fix-button-group-props
Browse files Browse the repository at this point in the history
Fix button groups props
  • Loading branch information
serdec authored Oct 12, 2023
2 parents d3c7bcc + b39fd9d commit eb264a2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/components/ButtonGroup/ButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export const ButtonGroup = ({ labels, activeIndex, onClick }: ButtonGroupProps)
return (
<Button
key={index}
active={index === activeIndex}
position={position}
$active={index === activeIndex}
$position={position}
onClick={() => onClick?.(index)}
role="button"
>
Expand All @@ -28,8 +28,8 @@ export const ButtonGroup = ({ labels, activeIndex, onClick }: ButtonGroupProps)
type ButtonPosition = "left" | "center" | "right";

interface ButtonProps {
active: boolean;
position: ButtonPosition;
$active: boolean;
$position: ButtonPosition;
theme: DefaultTheme;
}

Expand Down Expand Up @@ -57,8 +57,8 @@ const Button = styled.button<ButtonProps>`
justify-content: center;
align-items: center;
border: none;
background: ${({ active, theme }: ButtonProps) =>
active
background: ${({ $active, theme }: ButtonProps) =>
$active
? theme.click.button.group.color.background.active
: theme.click.button.group.color.background.default};
color: ${({ theme }) => theme.click.button.group.color.text.default};
Expand All @@ -84,10 +84,10 @@ const Button = styled.button<ButtonProps>`
theme.click.button.basic.color.primary.background.disabled};
}
border-radius: ${({ position }: ButtonProps) =>
position === "left"
border-radius: ${({ $position }: ButtonProps) =>
$position === "left"
? leftBorderRadius
: position === "right"
: $position === "right"
? rightBorderRadius
: centerBorderRadius};
`;

1 comment on commit eb264a2

@vercel
Copy link

@vercel vercel bot commented on eb264a2 Oct 12, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

click-ui – ./

click-ui-clickhouse.vercel.app
click-ui.vercel.app
click-ui-git-main-clickhouse.vercel.app

Please sign in to comment.