Skip to content
Snippets Groups Projects
Commit 6a77582e authored by esikkala's avatar esikkala
Browse files

Move pagination outside table container

parent 23759201
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ const styles = theme => ({ ...@@ -23,7 +23,7 @@ const styles = theme => ({
width: '100%', width: '100%',
height: 'auto', height: 'auto',
[theme.breakpoints.up('md')]: { [theme.breakpoints.up('md')]: {
height: 'calc(100% - 73px)' height: 'calc(100% - 130px)'
}, },
backgroundColor: theme.palette.background.paper, backgroundColor: theme.palette.background.paper,
borderTop: '1px solid rgba(224, 224, 224, 1);' borderTop: '1px solid rgba(224, 224, 224, 1);'
...@@ -35,7 +35,10 @@ const styles = theme => ({ ...@@ -35,7 +35,10 @@ const styles = theme => ({
backgroundColor: '#fff', backgroundColor: '#fff',
display: 'flex', display: 'flex',
justifyContent: 'flex-start', justifyContent: 'flex-start',
borderBottom: '1px solid rgba(224, 224, 224, 1);', borderTop: '1px solid rgba(224, 224, 224, 1);',
},
paginationCaption: {
minWidth: 108
}, },
progressContainer: { progressContainer: {
width: '100%', width: '100%',
...@@ -198,11 +201,12 @@ class ResultTable extends React.Component { ...@@ -198,11 +201,12 @@ class ResultTable extends React.Component {
const { classes } = this.props; const { classes } = this.props;
const { resultCount, paginatedResults, page, pagesize, sortBy, sortDirection, fetching } = this.props.data; const { resultCount, paginatedResults, page, pagesize, sortBy, sortDirection, fetching } = this.props.data;
return ( return (
<div className={classes.tableContainer}> <React.Fragment>
<TablePagination <TablePagination
component='div' component='div'
classes={{ classes={{
root: classes.paginationRoot root: classes.paginationRoot,
caption: classes.paginationCaption,
}} }}
count={resultCount} count={resultCount}
rowsPerPage={pagesize} rowsPerPage={pagesize}
...@@ -212,30 +216,32 @@ class ResultTable extends React.Component { ...@@ -212,30 +216,32 @@ class ResultTable extends React.Component {
onChangeRowsPerPage={this.handleOnchangeRowsPerPage} onChangeRowsPerPage={this.handleOnchangeRowsPerPage}
ActionsComponent={ResultTablePaginationActions} ActionsComponent={ResultTablePaginationActions}
/> />
{fetching ? <div className={classes.tableContainer}>
<div className={classes.progressContainer}> {fetching ?
<CircularProgress style={{ color: purple[500] }} thickness={5} /> <div className={classes.progressContainer}>
</div> <CircularProgress style={{ color: purple[500] }} thickness={5} />
: </div>
<Table className={classes.table}> :
<ResultTableHead <Table className={classes.table}>
columns={this.props.data.tableColumns} <ResultTableHead
onChangePage={this.handleChangePage} columns={this.props.data.tableColumns}
onSortBy={this.handleSortBy} onChangePage={this.handleChangePage}
onChangeRowsPerPage={this.handleOnChangeRowsPerPage} onSortBy={this.handleSortBy}
resultCount={resultCount} onChangeRowsPerPage={this.handleOnChangeRowsPerPage}
page={page} resultCount={resultCount}
pagesize={pagesize} page={page}
sortBy={sortBy} pagesize={pagesize}
sortDirection={sortDirection} sortBy={sortBy}
routeProps={this.props.routeProps} sortDirection={sortDirection}
/> routeProps={this.props.routeProps}
<TableBody> />
{paginatedResults.map(row => this.rowRenderer(row))} <TableBody>
</TableBody> {paginatedResults.map(row => this.rowRenderer(row))}
</Table> </TableBody>
} </Table>
</div> }
</div>
</React.Fragment>
); );
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment