lucid-ui
Version:
A UI component library from AppNexus.
23 lines (22 loc) • 884 B
JavaScript
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, onEscape: _.partial(this.handleOpenClose, false), onBackgroundClick: _.partial(this.handleOpenClose, false) },
React.createElement("div", { style: { color: '#fff' } }, "User cannot interact with the background (except scrolling)."))));
},
});