Fix table height (#16275)

This commit is contained in:
Geido 2021-08-17 09:58:13 +02:00 committed by GitHub
parent d13b081cfe
commit 9876c36f6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -56,14 +56,15 @@ const EmptyWrapper = styled.div`
`;
const TableViewStyles = styled.div<{
hasPagination?: boolean;
isPaginationSticky?: boolean;
scrollTable?: boolean;
small?: boolean;
}>`
${({ scrollTable, theme }) =>
${({ hasPagination, scrollTable, theme }) =>
scrollTable &&
`
height: 300px;
height: ${hasPagination ? '300px' : '380px'};
margin-bottom: ${theme.gridUnit * 4}px;
overflow: auto;
`}
@ -191,10 +192,11 @@ const TableView = ({
}
const isEmpty = !loading && content.length === 0;
const hasPagination = pageCount > 1 && withPagination;
return (
<>
<TableViewStyles {...props}>
<TableViewStyles hasPagination={hasPagination} {...props}>
<TableCollection
getTableProps={getTableProps}
getTableBodyProps={getTableBodyProps}
@ -217,7 +219,7 @@ const TableView = ({
</EmptyWrapperComponent>
)}
</TableViewStyles>
{pageCount > 1 && withPagination && (
{hasPagination && (
<PaginationStyles
className="pagination-container"
isPaginationSticky={props.isPaginationSticky}