Skip to content

Commit

Permalink
fix(atoms): change constants for the checkbox colors
Browse files Browse the repository at this point in the history
  • Loading branch information
ej9x committed May 21, 2018
1 parent 7492e40 commit a84ad72
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/atoms/dataEntry/Checkbox/Checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type CheckboxProps = {
/** checkbox label */
label?: string,
/** color of the check */
color?: 'green' | 'blue' | 'primary',
color?: 'primary' | 'secondary',
/** checked state */
checked?: boolean,
/** when error then show error styles */
Expand Down Expand Up @@ -46,8 +46,8 @@ class Checkbox extends PureComponent<CheckboxProps> {
return (
<CheckboxWrapperTag { ...rest } tagName="label">
<CheckboxSquareTag hasError={ hasError } disabled={ disabled } tagName="div">
<CheckboxIconTag checked={ checked } tagName="div">
<Icon name="Check" color="primary" size="xs" />
<CheckboxIconTag checked={ checked } color={ color } tagName="div">
<Icon name="Check" size="xs" />
</CheckboxIconTag>
</CheckboxSquareTag>
<CheckboxTag checked={ checked } onChange={ this.onChange } type="checkbox" tagName="input" />
Expand Down
3 changes: 3 additions & 0 deletions src/atoms/dataEntry/Checkbox/Checkbox.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export default (asStory: *) => {
.add('without label', () => (
<Checkbox checked />
))
.add('without secondary color', () => (
<Checkbox color="secondary" label="Checkbox" checked />
))
.add('with state', () => (
<CheckboxState>
{
Expand Down
6 changes: 6 additions & 0 deletions src/atoms/dataEntry/Checkbox/Checkbox.theme.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @flow

import { createStyledTag, createTheme, getThemeColors } from 'utils';

const name = 'checkbox';
Expand All @@ -10,6 +12,10 @@ const theme = createTheme(name, (colors: *): * => ({
disabled: {
backgroundColor: colors.LIGHT_GRAY4,
},
color: {
primary: { color: colors.PRIMARY },
secondary: { color: colors.SECONDARY },
},
},
}));

Expand Down

0 comments on commit a84ad72

Please sign in to comment.