mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-28 21:18:47 +00:00
Example usage of the coor picker
This commit is contained in:
parent
b954a69d69
commit
bd862fa9cc
1 changed files with 14 additions and 7 deletions
|
|
@ -3,10 +3,17 @@ const { storiesOf } = require('@storybook/react');
|
|||
const { ColorPicker } = require('stremio/common');
|
||||
const styles = require('./styles');
|
||||
|
||||
storiesOf('ColorPicker', module).add('ColorPicker', () => (
|
||||
<ColorPicker
|
||||
className={styles['color-picker-container']}
|
||||
value={'#000000'}
|
||||
onChange={(color) => { console.log(color) }}
|
||||
/>
|
||||
));
|
||||
const ColorPickerExampleusage = () => {
|
||||
const [color, setColor] = React.useState('rgba(166, 196, 213, 0.97)');
|
||||
return (
|
||||
<div style={{ color: 'var(--color-surfacelighter)', padding: '1em' }}>
|
||||
<ColorPicker
|
||||
className={styles['color-picker-container']}
|
||||
value={color}
|
||||
onChange={(color) => { setColor(color) }}
|
||||
/>
|
||||
<div style={{ marginTop: '1em' }}>Current color is {color}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
storiesOf('ColorPicker', module).add('ColorPicker', () => <ColorPickerExampleusage />);
|
||||
|
|
|
|||
Loading…
Reference in a new issue