1 |
|
2 | import React from 'react';
|
3 | import { storiesOf } from '@storybook/react';
|
4 | import Button from '../src/components/button-add-remove';
|
5 |
|
6 | class StateContainer extends React.PureComponent<Object, { boolean: boolean }> {
|
7 | state = { boolean: false };
|
8 |
|
9 | onClick = () => {
|
10 | this.setState(({ boolean }) => ({ boolean: !boolean }));
|
11 | };
|
12 | render() {
|
13 | return (
|
14 | <Button
|
15 | {...this.props}
|
16 | handleOnClick={this.onClick}
|
17 | triggerBoolean={this.state.boolean}
|
18 | />
|
19 | );
|
20 | }
|
21 | }
|
22 |
|
23 | storiesOf('Add Remove Button', module).add('Button', () => (
|
24 | <StateContainer isSmall={false} title="Bork bork bork" />
|
25 | ));
|