Commit 07ae230b authored by Riri Novita's avatar Riri Novita

tambahan

parent 837d3925
import React, { Component } from "react";
import { createMuiTheme, FormControlLabel, Input, MuiThemeProvider, TableCell, Typography, withStyles } from "@material-ui/core";
import { createMuiTheme, FormControlLabel, Input, MuiThemeProvider, Snackbar, TableCell, Typography, withStyles } from "@material-ui/core";
import MUIDataTable from "mui-datatables";
import api from '../../api';
import Constant from '../../library/Constant';
......@@ -78,8 +78,7 @@ export default class TableProgressReport extends Component {
})
}
} else {
alert(response.data.message);
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', visiblePopup: false, loading: false})
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
......@@ -87,6 +86,10 @@ export default class TableProgressReport extends Component {
})
}
closeAlert() {
this.setState({ alert: false })
}
render() {
let dataTable2 = this.props.dataTable;
......@@ -718,6 +721,11 @@ export default class TableProgressReport extends Component {
return (
<div>
<Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
<Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
{this.state.messageAlert}
</Alert>
</Snackbar>
<div style={{ padding: "0px 20px 20px 20px", width: this.props.width - (this.props.open === true ? 350 : 100) }}>
{this.state.loading && loadingComponent}
<MuiThemeProvider theme={getMuiTheme()}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment