UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

29 lines 983 B
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, onEscape: _partial(this.handleOpenClose, false), onBackgroundClick: _partial(this.handleOpenClose, false) }, /*#__PURE__*/React.createElement("div", { style: { color: '#fff' } }, "User cannot interact with the background (except scrolling)."))); } });