35 lines
977 B
Plaintext
35 lines
977 B
Plaintext
// React Toolbox Playground
|
|
// -------------------------------------------------------------------
|
|
// Use this area to try components. You will find next to each example
|
|
// in the documentation a button to load the code in the playground.
|
|
// Remember that you can leave the playground and keep your progress
|
|
// but loading new examples will smash your changes!
|
|
|
|
class Welcome extends React.Component {
|
|
state = {
|
|
active: false
|
|
};
|
|
|
|
handleToggle = () => {
|
|
this.setState({active: !this.state.active});
|
|
}
|
|
|
|
actions = [{
|
|
label: 'Great!',
|
|
onClick: this.handleToggle
|
|
}];
|
|
|
|
render () {
|
|
return (
|
|
<section>
|
|
<Button label="Let's start!" onClick={this.handleToggle} />
|
|
<Dialog actions={this.actions} active={this.state.active} title='My awesome dialog' type="small">
|
|
<p>Here you can add arbitrary content. Components like Pickers are using dialogs now.</p>
|
|
</Dialog>
|
|
</section>
|
|
);
|
|
}
|
|
}
|
|
|
|
return <Welcome />;
|