Skip to content

Commit

Permalink
chore(Button): add checked prop
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisVorop authored and awinogradov committed Aug 29, 2023
1 parent 2fe9e31 commit c8649e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
iconLeft?: React.ReactNode;
iconRight?: React.ReactNode;
brick?: 'left' | 'right' | 'center';
/** This property is applicable only when the 'view' prop is set to 'default'. */
checked?: boolean;
hue?: [number, number];
children?: React.ReactNode;
}
Expand Down Expand Up @@ -112,12 +114,12 @@ const StyledButton = styled(
}
`}
${({ view }) =>
${({ view, checked }) =>
view === 'default' &&
`
color: ${gray10};
border-color: ${gray7};
background-color: ${gray4};
background-color: ${checked ? gray6 : gray4};
--color: ${gray9};
--color-hover: ${gray10};
Expand Down

0 comments on commit c8649e0

Please sign in to comment.