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

Fix button groups props #175

Merged
merged 2 commits into from
Oct 12, 2023
Merged
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
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};
`;