From b8de127c425958d59e635e915af7f5c3c7a1744f Mon Sep 17 00:00:00 2001 From: Mati Dastugue Date: Thu, 15 Apr 2021 20:11:22 -0300 Subject: [PATCH] Assets list - Very long empty page (#2159) Co-authored-by: Fernando --- src/components/Table/index.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/Table/index.tsx b/src/components/Table/index.tsx index f7af3ad5..97aad574 100644 --- a/src/components/Table/index.tsx +++ b/src/components/Table/index.tsx @@ -36,7 +36,7 @@ const styles = { }, } -const FIXED_HEIGHT = 49 +const FIXED_EMPTY_HEIGHT = 255 const backProps = { 'aria-label': 'Previous Page', @@ -101,8 +101,8 @@ class GnoTable extends React.Component { })) } - getEmptyStyle = (emptyRows) => ({ - height: FIXED_HEIGHT * emptyRows, + getEmptyStyle = () => ({ + height: `calc(100vh - ${FIXED_EMPTY_HEIGHT}px)`, borderTopRightRadius: sm, borderTopLeftRadius: sm, backgroundColor: 'white', @@ -155,7 +155,6 @@ class GnoTable extends React.Component { sortedData = sortedData.slice(page * displayRows, page * displayRows + displayRows) } - const emptyRows = displayRows - Math.min(displayRows, data.size - page * displayRows) const isEmpty = size === 0 && !disableLoadingOnEmptyTable return ( @@ -167,7 +166,7 @@ class GnoTable extends React.Component { )} {isEmpty && ( - + )}