fix(accounts): hide no rows label when there is only pinned row (#4833)

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
This commit is contained in:
Bartłomiej Głownia 2023-09-20 22:03:07 +02:00 committed by GitHub
parent 0b1987d4ce
commit 5db3453ba5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -312,7 +312,6 @@ export const AccountTable = ({
]);
const data = rowData?.filter((data) => data.asset.id !== pinnedAsset?.id);
return (
<AgGrid
{...props}
@ -321,6 +320,13 @@ export const AccountTable = ({
rowData={data}
defaultColDef={defaultColDef}
columnDefs={colDefs}
overlayNoRowsTemplate={
// account for the pinned asset is filtered out to prevent duplicate
// data in the pinned row and the main table rows. AgGrid will not
// consider the pinned row when determining whether to show the no
// rows template or not so we need to override it
rowData?.length ? '<span />' : props.overlayNoRowsTemplate
}
getRowHeight={getPinnedAssetRowHeight}
pinnedTopRowData={pinnedRow ? [pinnedRow] : undefined}
/>