mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-07 15:23:50 +00:00
Assets list - Very long empty page (#2159)
Co-authored-by: Fernando <fernando.greco@gmail.com>
This commit is contained in:
parent
44a646e789
commit
b8de127c42
@ -36,7 +36,7 @@ const styles = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const FIXED_HEIGHT = 49
|
const FIXED_EMPTY_HEIGHT = 255
|
||||||
|
|
||||||
const backProps = {
|
const backProps = {
|
||||||
'aria-label': 'Previous Page',
|
'aria-label': 'Previous Page',
|
||||||
@ -101,8 +101,8 @@ class GnoTable extends React.Component<any, any> {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
getEmptyStyle = (emptyRows) => ({
|
getEmptyStyle = () => ({
|
||||||
height: FIXED_HEIGHT * emptyRows,
|
height: `calc(100vh - ${FIXED_EMPTY_HEIGHT}px)`,
|
||||||
borderTopRightRadius: sm,
|
borderTopRightRadius: sm,
|
||||||
borderTopLeftRadius: sm,
|
borderTopLeftRadius: sm,
|
||||||
backgroundColor: 'white',
|
backgroundColor: 'white',
|
||||||
@ -155,7 +155,6 @@ class GnoTable extends React.Component<any, any> {
|
|||||||
sortedData = sortedData.slice(page * displayRows, page * displayRows + displayRows)
|
sortedData = sortedData.slice(page * displayRows, page * displayRows + displayRows)
|
||||||
}
|
}
|
||||||
|
|
||||||
const emptyRows = displayRows - Math.min(displayRows, data.size - page * displayRows)
|
|
||||||
const isEmpty = size === 0 && !disableLoadingOnEmptyTable
|
const isEmpty = size === 0 && !disableLoadingOnEmptyTable
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -167,7 +166,7 @@ class GnoTable extends React.Component<any, any> {
|
|||||||
</Table>
|
</Table>
|
||||||
)}
|
)}
|
||||||
{isEmpty && (
|
{isEmpty && (
|
||||||
<Row className={classes.loader} style={this.getEmptyStyle(emptyRows + 1)}>
|
<Row className={classes.loader} style={this.getEmptyStyle()}>
|
||||||
<Loader size="sm" />
|
<Loader size="sm" />
|
||||||
</Row>
|
</Row>
|
||||||
)}
|
)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user