-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added recommended colors array
- Loading branch information
Showing
6 changed files
with
89 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** @jsx jsx */ | ||
import { jsx } from '@emotion/core'; | ||
|
||
const ColorSquare = ({color, onClick, disabled}) => { | ||
return ( | ||
<div | ||
onClick={onClick} | ||
css={{...styles.square, ...(onClick && styles.button)}} | ||
style={{ cursor: (onClick && !disabled) ? 'pointer' : 'normal' }} | ||
> | ||
<div css={styles.content} style={{ backgroundColor: color }} /> | ||
</div> | ||
); | ||
}; | ||
|
||
ColorSquare.defaultProps = { | ||
onClick: undefined, | ||
disabled: false, | ||
recommendedColors: [] | ||
}; | ||
|
||
const styles = { | ||
button: { | ||
padding: 3, | ||
border: '1px solid #bebebe', | ||
borderRadius: 4, | ||
}, | ||
square: { | ||
display: 'flex', | ||
width: 30, | ||
height: 30, | ||
}, | ||
content: { | ||
flex: 1, | ||
} | ||
}; | ||
|
||
export default ColorSquare; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters