Skip to content

Commit

Permalink
fix(checkbox): added add color prop for checkbox icon
Browse files Browse the repository at this point in the history
  • Loading branch information
cnkeats committed Apr 4, 2022
1 parent a829c3f commit 24cb9db
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ export const CheckboxContainer = styled.div`
`;

export const BaseIcon = styled(Icon)`
overflow: visible;
height: 1em;
width: 1em;
${({ color }) => `
overflow: visible;
color: ${color};
width: 1em;
height: 1em;
`}
` as StyledSubcomponentType;

const CheckIcon = styled(BaseIcon)`
Expand Down Expand Up @@ -126,7 +129,6 @@ const NeutralIcon = styled(BaseIcon)`
return `
color: ${color};
path {
stroke: ${color};
stroke-width: 2px;
}
`;
Expand All @@ -148,6 +150,7 @@ export interface CheckboxProps {

checkboxType?: CheckboxTypes;
variant?: variants;
color?: string;
children?: React.ReactNode;
checked?: boolean;
disabled?: boolean;
Expand Down Expand Up @@ -190,6 +193,7 @@ const Checkbox = ({

checkboxType = CheckboxTypes.check,
variant = variants.fill,
color,
checked = false,
children,
disabled = false,
Expand Down Expand Up @@ -233,6 +237,7 @@ const Checkbox = ({
aria-hidden="true"
data-test-id="hsui-Checkbox-Icon"
path={iconPath}
color={color}
variant={variant}
{...iconProps}
/>
Expand Down

0 comments on commit 24cb9db

Please sign in to comment.