Skip to content

Commit 47a1674

Browse files
authored
Merge branch 'master' into m3-clusters
2 parents 1d61147 + edf687f commit 47a1674

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

portal-ui/src/screens/Console/Common/TableWrapper/TableWrapper.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
Paper,
2828
Grid,
2929
Checkbox,
30+
Typography,
3031
} from "@material-ui/core";
3132
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
3233
import { TablePaginationActionsProps } from "@material-ui/core/TablePagination/TablePaginationActions";
@@ -98,6 +99,7 @@ const styles = (theme: Theme) =>
9899
overflow: "auto",
99100
flexDirection: "column",
100101
padding: "19px 38px",
102+
minHeight: "200px",
101103
},
102104
minTableHeader: {
103105
color: "#393939",
@@ -137,6 +139,10 @@ const styles = (theme: Theme) =>
137139
checkBoxRow: {
138140
borderColor: borderColor,
139141
},
142+
loadingBox: {
143+
paddingTop: "100px",
144+
paddingBottom: "100px",
145+
},
140146
...checkboxIcons,
141147
});
142148

@@ -216,7 +222,16 @@ const TableWrapper = ({
216222
return (
217223
<Grid item xs={12}>
218224
<Paper className={classes.paper}>
219-
{isLoading && <LinearProgress />}
225+
{isLoading && (
226+
<Grid container className={classes.loadingBox}>
227+
<Grid item xs={12} style={{ textAlign: "center" }}>
228+
<Typography component="h3">Loading...</Typography>
229+
</Grid>
230+
<Grid item xs={12}>
231+
<LinearProgress />
232+
</Grid>
233+
</Grid>
234+
)}
220235
{records && records.length > 0 ? (
221236
<Table size="small" stickyHeader={stickyHeader}>
222237
<TableHead className={classes.minTableHeader}>
@@ -288,7 +303,9 @@ const TableWrapper = ({
288303
</TableBody>
289304
</Table>
290305
) : (
291-
<div>{`There are no ${entityName} yet.`}</div>
306+
<React.Fragment>
307+
{!isLoading && <div>{`There are no ${entityName} yet.`}</div>}
308+
</React.Fragment>
292309
)}
293310
</Paper>
294311
{paginatorConfig && (

0 commit comments

Comments
 (0)