Skip to content

Commit

Permalink
Code simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
kireerik committed Jun 5, 2017
1 parent ccee257 commit b89eeb2
Showing 1 changed file with 20 additions and 29 deletions.
49 changes: 20 additions & 29 deletions src/application/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,35 +38,26 @@ class Main extends Component {
}
}

handleRequestClose = () => {
this.setState({
open: false
})
}

handleTouchTap = () => {
this.setState({
open: true
})
}

render() {
const standardActions = (
<FlatButton label="Ok" primary={true} onTouchTap={this.handleRequestClose} />
)

return (
<MuiThemeProvider muiTheme={this.muiTheme}>
<Div>
<h1>Material-UI</h1>
<h2>example project</h2>
<RaisedButton label="Super Secret Password" secondary={true} onTouchTap={this.handleTouchTap} />

<Dialog open={this.state.open} title="Super Secret Password" actions={standardActions} onRequestClose={this.handleRequestClose}>1-2-3-4-5</Dialog>
</Div>
</MuiThemeProvider>
)
}
handleRequestClose = () => this.setState({
open: false
})

handleTouchTap = () => this.setState({
open: true
})

render = () =>
<MuiThemeProvider muiTheme={this.muiTheme}>
<Div>
<h1>Material-UI</h1>
<h2>example project</h2>
<RaisedButton label="Super Secret Password" secondary={true} onTouchTap={this.handleTouchTap} />

<Dialog open={this.state.open} title="Super Secret Password" actions={
<FlatButton label="Ok" primary={true} onTouchTap={this.handleRequestClose} />
} onRequestClose={this.handleRequestClose}>1-2-3-4-5</Dialog>
</Div>
</MuiThemeProvider>
}

export default Main

0 comments on commit b89eeb2

Please sign in to comment.