react-toolbox/docs/app/components/layout/main/modules/examples/dialog_example_1.txt

34 lines
778 B
Plaintext

class DialogTest extends React.Component {
state = {
active: false
};
handleToggle = () => {
this.setState({active: !this.state.active});
}
actions = [
{ label: "Cancel", onClick: this.handleToggle },
{ label: "Save", onClick: this.handleToggle }
];
render () {
return (
<div>
<Button label='Show my dialog' onClick={this.handleToggle} />
<Dialog
actions={this.actions}
active={this.state.active}
onEscKeyDown={this.handleToggle}
onOverlayClick={this.handleToggle}
title='My awesome dialog'
>
<p>Here you can add arbitrary content. Components like Pickers are using dialogs now.</p>
</Dialog>
</div>
);
}
}
return <DialogTest />;