Skip to content

Commit

Permalink
feat(common): add dynamic size for GroupedDataTable
Browse files Browse the repository at this point in the history
  • Loading branch information
skamril authored and hdinia committed Oct 10, 2023
1 parent de4e563 commit 404db0e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,13 @@ function Thermal() {
}

return (
<Box sx={{ width: 1, p: 2, overflow: "auto" }}>
<GroupedDataTable
data={clustersWithCapacity}
columns={columns}
groups={groups}
onCreate={handleCreateRow}
onDelete={handleDeleteSelection}
/>
</Box>
<GroupedDataTable
data={clustersWithCapacity}
columns={columns}
groups={groups}
onCreate={handleCreateRow}
onDelete={handleDeleteSelection}
/>
);
}

Expand Down
13 changes: 8 additions & 5 deletions webapp/src/components/common/GroupedDataTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ function GroupedDataTable<TData extends TRow>({
enableStickyFooter
enableStickyHeader
enablePagination={false}
muiTableContainerProps={{ sx: { maxHeight: 550 } }}
onRowSelectionChange={setRowSelection}
state={{ rowSelection }}
renderTopToolbarCustomActions={() => (
Expand Down Expand Up @@ -181,15 +180,19 @@ function GroupedDataTable<TData extends TRow>({
}}
muiTableBodyCellProps={{
align: "right",
sx: {
borderBottom: "1px solid rgba(224, 224, 224, 0.3)",
},
}}
muiTableFooterCellProps={{
align: "right",
}}
muiTableProps={{
muiTablePaperProps={{
sx: {
"& .MuiTableCell-root": {
borderBottom: "1px solid rgba(224, 224, 224, 0.3)",
},
width: 1,
display: "flex",
flexDirection: "column",
overflow: "auto",
},
}}
/>
Expand Down

0 comments on commit 404db0e

Please sign in to comment.