UNPKG

695 BJavaScriptView Raw
1/* @flow */
2import React from 'react';
3import { storiesOf } from '@storybook/react';
4import Button from '../src/components/button-add-remove';
5
6class 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
23storiesOf('Add Remove Button', module).add('Button', () => (
24 <StateContainer isSmall={false} title="Bork bork bork" />
25));