Skip to content

Commit

Permalink
implement scrollable feature for PreviewTable
Browse files Browse the repository at this point in the history
  • Loading branch information
liberty-rising committed Feb 6, 2024
1 parent dd520bd commit 344311b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
12 changes: 11 additions & 1 deletion frontend/src/components/layouts/AppLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,17 @@ const AppLayout = ({ children }) => {
<Box sx={{ display: "flex" }}>
<Header navLinks={navLinks} />
<Navigation />
<Box component="main" sx={{ flexGrow: 1, p: 6, marginTop: "10px" }}>
<Box
component="main"
sx={{
flexGrow: 1,
p: 6,
marginTop: "10px",
marginTop: "10px",
maxWidth: "100vw", // Ensures the main content does not exceed the viewport width
overflowX: "hidden",
}}
>
<Toolbar />
{children}
</Box>
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/pages/upload/PreviewTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ function PreviewTable({ columnNames, previewData, onChangePreviewData }) {
emptyMessage="Upload your files and click preview to see the data"
editMode="cell"
resizableColumns
scrollable
scrollHeight="flex"
showGridlines
tableStyle={{ minWidth: "150px" }}
>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/upload/UploadPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ function UploadPage() {
<FileUploader setFiles={setUploadFiles} id="upload-page-uploader" />
</Box>

<Box mt={2}>
<Box mt={2} sx={{ width: "100%", maxWidth: "100%" }}>
{((columnNames && columnNames.length > 0) || previewData) && (
<PreviewTable
columnNames={columnNames}
Expand Down

0 comments on commit 344311b

Please sign in to comment.