added refresh button on resource chart close #31
This commit is contained in:
@@ -11,11 +11,15 @@ import CardContent from '@material-ui/core/CardContent';
|
|||||||
import Typography from '@material-ui/core/Typography';
|
import Typography from '@material-ui/core/Typography';
|
||||||
import { makeStyles } from '@material-ui/core/styles';
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
import Grid from '@material-ui/core/Grid';
|
import Grid from '@material-ui/core/Grid';
|
||||||
|
import Button from '@material-ui/core/Button';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
},
|
},
|
||||||
|
card: {
|
||||||
|
padding: 20
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const output = (data) => {
|
const output = (data) => {
|
||||||
@@ -86,6 +90,8 @@ export default function ResourceChart(props) {
|
|||||||
case 7:
|
case 7:
|
||||||
qualitySortedData[qualitySortedData.length - 1]["q7"] = dataWithDate[i]["price"];
|
qualitySortedData[qualitySortedData.length - 1]["q7"] = dataWithDate[i]["price"];
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qualitySortedData.push(dataWithDate[i]);
|
qualitySortedData.push(dataWithDate[i]);
|
||||||
@@ -105,7 +111,9 @@ export default function ResourceChart(props) {
|
|||||||
loadData();
|
loadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleClick = (e) => {
|
||||||
|
loadData()
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.root}>
|
<div className={classes.root}>
|
||||||
@@ -116,10 +124,13 @@ export default function ResourceChart(props) {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12}>
|
<Grid item xs={12}>
|
||||||
<Card>
|
<Card className={classes.card}>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
{output(data)}
|
{output(data)}
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
<Button variant="contained" color="secondary" onClick={handleClick}>
|
||||||
|
Refresh
|
||||||
|
</Button>
|
||||||
</Card>
|
</Card>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
Reference in New Issue
Block a user