1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-28 19:06:12 +01:00

feat: make table scrollable (#6632)

This commit is contained in:
Jaanus Sellin 2024-03-20 15:29:15 +02:00 committed by GitHub
parent 99b5db1691
commit 0c0530ddcf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,6 +19,9 @@ const Container = styled(Box)(({ theme }) => ({
display: 'flex',
flexDirection: 'column',
gap: theme.spacing(2),
}));
const TableContainer = styled(Box)(({ theme }) => ({
overflowY: 'auto',
maxHeight: theme.spacing(45),
}));
@ -208,23 +211,25 @@ export const LeadTimeForChanges = ({ leadTime }: ILeadTimeForChangesProps) => {
<Typography variant='h3'>
Lead time for changes (per release flag)
</Typography>
<Table {...getTableProps()}>
<SortableTableHeader headerGroups={headerGroups} />
<TableBody {...getTableBodyProps()}>
{rows.map((row) => {
prepareRow(row);
return (
<TableRow hover {...row.getRowProps()}>
{row.cells.map((cell) => (
<TableCell {...cell.getCellProps()}>
{cell.render('Cell')}
</TableCell>
))}
</TableRow>
);
})}
</TableBody>
</Table>
<TableContainer>
<Table {...getTableProps()}>
<SortableTableHeader headerGroups={headerGroups} />
<TableBody {...getTableBodyProps()}>
{rows.map((row) => {
prepareRow(row);
return (
<TableRow hover {...row.getRowProps()}>
{row.cells.map((cell) => (
<TableCell {...cell.getCellProps()}>
{cell.render('Cell')}
</TableCell>
))}
</TableRow>
);
})}
</TableBody>
</Table>
</TableContainer>
<ConditionallyRender
condition={rows.length === 0}
show={