Moved the styles in the styles.less file. Unwrapped the setColor function

This commit is contained in:
Vladimir Borisov 2019-09-18 09:34:08 +03:00
parent bd862fa9cc
commit 8370789211
No known key found for this signature in database
GPG key ID: F9A584BE4FCB6603
2 changed files with 8 additions and 4 deletions

View file

@ -6,13 +6,12 @@ const styles = require('./styles');
const ColorPickerExampleusage = () => {
const [color, setColor] = React.useState('rgba(166, 196, 213, 0.97)');
return (
<div style={{ color: 'var(--color-surfacelighter)', padding: '1em' }}>
<div className={styles['demo-container']}>
<ColorPicker
className={styles['color-picker-container']}
value={color}
onChange={(color) => { setColor(color) }}
onChange={setColor}
/>
<div style={{ marginTop: '1em' }}>Current color is {color}</div>
<div className={styles['test-output']}>Current color is {color}</div>
</div>
);
}

View file

@ -0,0 +1,5 @@
.demo-container {
color: var(--color-surfacelighter);
padding: 1rem;
.test-output { margin-top: 1rem; }
}