UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

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