UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

41 lines 1.56 kB
import _times from "lodash/times"; import _partial from "lodash/partial"; import React from 'react'; import createClass from 'create-react-class'; import { Button, Dialog } from '../../../index'; export default createClass({ getInitialState: function getInitialState() { return { isShown: false }; }, handleShow: function handleShow(isShown) { this.setState({ isShown: isShown }); }, render: function render() { return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, { onClick: _partial(this.handleShow, !this.state.isShown) }, "Toggle"), /*#__PURE__*/React.createElement(Dialog, { isShown: this.state.isShown, handleClose: _partial(this.handleShow, !this.state.isShown), Header: "Header", size: "medium" }, /*#__PURE__*/React.createElement("div", { key: 'info' }, "For better UX, we recommend NOT handling onEscape and onBackgroundClick when isModal is true. The term \"modal\" implies that the user needs to interact with one of the buttons in the footer to exit the dialog."), _times(50).map(function (i) { return /*#__PURE__*/React.createElement("div", { key: i }, "Body"); }), /*#__PURE__*/React.createElement(Dialog.Footer, null, /*#__PURE__*/React.createElement(Button, { kind: "invisible", onClick: _partial(this.handleShow, false), style: { marginRight: '9px' } }, "Cancel"), /*#__PURE__*/React.createElement(Button, { kind: "primary" }, "Save")))); } });