Dialogs
/**
* Ecommerce Dashboard
*/
import React, { Component } from 'react'
...
export default class EcommerceDashboard extends Component {
// Dialog state
state = {
open: false
}
// Dialog Functions
handleClickOpen() {
this.setState({ open: true });
};
handleClose() {
this.setState({ open: false });
};
render() {
...
<div className="col-sm-6 col-md-12 mb-30
">
// Dialog Code
<div>
<Button variant="contained" onClick={() => this.handleClickOpen()} color="primary" className="text-white">Open alert dialog</Button>
<Dialog open={this.state.open} onClose={() => this.handleClose()} aria-labelledby="alert-dialog-title" aria-describedby="alert-dialog-description">
<DialogTitle id="alert-dialog-title">{"Use Google's location service?"}</DialogTitle>
<DialogContent>
<DialogContentText id="alert-dialog-description">
Let Google help apps determine location. This means sending anonymous location data to Google, even when no apps are running.
</DialogContentText>
</DialogContent>
<DialogActions>
<Button variant="contained" onClick={() => this.handleClose()} className="btn-danger text-white"> Disagree </Button>
<Button variant="contained" onClick={() => this.handleClose()} color="primary" className="text-white" autoFocus> Agree </Button>
</DialogActions>
</Dialog>
</div>
</div>
... 


Last updated