use render callbacks for loading notification

This commit is contained in:
Rick Watson
2019-08-09 18:55:11 +01:00
parent ff85c2e661
commit ef8061cbc3
12 changed files with 103 additions and 80 deletions

View File

@ -22,7 +22,7 @@ const useStyles = makeStyles(theme => ({
export default function LoadingNotification(props) {
const classes = useStyles();
const { fetched, errorMessage, onReset, children } = props;
const { fetched, errorMessage, onReset, render } = props;
return (
<div>
{
@ -37,7 +37,7 @@ export default function LoadingNotification(props) {
</Button>
</div>
:
children
render()
:
<div className={classes.loadingSettings}>
<LinearProgress className={classes.loadingSettingsDetails} />
@ -53,5 +53,6 @@ export default function LoadingNotification(props) {
LoadingNotification.propTypes = {
fetched: PropTypes.bool.isRequired,
onReset: PropTypes.func.isRequired,
errorMessage: PropTypes.string
errorMessage: PropTypes.string,
render: PropTypes.func.isRequired
};