UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

32 lines 1.07 kB
import _partial from "lodash/partial"; import React from 'react'; import createClass from 'create-react-class'; import { Button, Overlay } from '../../../index'; export default createClass({ getInitialState: function getInitialState() { return { isShown: false }; }, handleOpenClose: function handleOpenClose(isShown) { this.setState({ isShown: isShown }); }, render: function render() { return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, { onClick: _partial(this.handleOpenClose, !this.state.isShown) }, "Toggle"), /*#__PURE__*/React.createElement(Overlay, { isShown: this.state.isShown, isModal: false, onEscape: _partial(this.handleOpenClose, false) }, /*#__PURE__*/React.createElement("div", { style: { backgroundColor: '#eee', padding: '100px' } }, "User can still interact with the background.", /*#__PURE__*/React.createElement(Button, { onClick: _partial(this.handleOpenClose, false) }, "Close")))); } });