lucid-ui
Version:
A UI component library from AppNexus.
25 lines (24 loc) • 1.15 kB
JavaScript
import React from 'react';
import createClass from 'create-react-class';
import { Collapsible } from '../../../index';
const onRest = () => {
alert('I am and always will be the optimist. The hoper of far-flung hopes and the dreamer of improbable dreams.');
};
export default createClass({
getInitialState() {
return {
isExpanded: false,
};
},
handleToggle() {
this.setState({
isExpanded: !this.state.isExpanded,
});
},
render() {
return (React.createElement("section", null,
React.createElement("button", { onClick: this.handleToggle }, "toggle"),
React.createElement(Collapsible, { isExpanded: this.state.isExpanded, style: { background: 'lightgray' }, onRest: onRest },
React.createElement("p", null, "Everybody knows that everybody dies. But not every day. Not today. Some days are special. Some days are so, so blessed. Some days, nobody dies at all. Now and then, every once in a very long while, every day in a million days, when the wind stands fair and the Doctor comes to call, everybody lives."))));
},
});