import Drawer from '..';
import React from 'react';
import ReactDOM from 'react-dom';
import { Button } from '../..';

class Demo extends React.Component {
  state = {
    visible: false,
  };

  onOpen = () => {
    this.setState({
      visible: true,
    });
  };

  onClose = (reason, e) => {
    console.log('onClose: ', reason, e);
    this.setState({
      visible: false,
    });
  };

  render() {
    return (
      <div>
        <Button type="primary" onClick={this.onOpen} style={{ marginRight: '20px' }}> open large drawer</Button>
        <Drawer
          title="标题"
          placement="right"
          size="large"
          visible={this.state.visible}
          onClose={this.onClose}>
                    Start your business here by searching a popular product
        </Drawer>
      </div>
    );
  }
}

ReactDOM.render(<Demo />, document.getElementById('drawer-demo-7'));
