Skip to content

Commit

Permalink
feat(ui-debug): enhance Matrix component
Browse files Browse the repository at this point in the history
  • Loading branch information
skamril committed Aug 6, 2024
1 parent 5298b5b commit a1aac53
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 28 deletions.
29 changes: 15 additions & 14 deletions webapp/src/components/App/Singlestudy/explore/Debug/Data/Matrix.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
import { useOutletContext } from "react-router";
import { MatrixStats, StudyMetadata } from "../../../../../../common/types";
import { Root, Content } from "./style";
import { MatrixStats } from "../../../../../../common/types";
import MatrixInput from "../../../../../common/MatrixInput";
import ViewWrapper from "../../../../../common/page/ViewWrapper";

interface Props {
studyId: string;
path: string;
}

function Matrix({ path }: Props) {
const { study } = useOutletContext<{ study: StudyMetadata }>();

////////////////////////////////////////////////////////////////
// JSX
////////////////////////////////////////////////////////////////
function Matrix({ studyId, path }: Props) {
const filename = path.split("/").pop();
const isUserFolder = path.startsWith("/user/");

return (
<Root>
<Content>
<MatrixInput study={study} url={path} computStats={MatrixStats.NOCOL} />
</Content>
</Root>
<ViewWrapper>
<MatrixInput
title={filename}
study={studyId}
url={path}
computStats={MatrixStats.NOCOL}
disableImport={!isUserFolder}
/>
</ViewWrapper>
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { styled, Box, Paper } from "@mui/material";
import { styled, Box } from "@mui/material";

export const Root = styled(Box)(({ theme }) => ({
flex: 1,
Expand All @@ -19,16 +19,3 @@ export const Header = styled(Box)(({ theme }) => ({
alignItems: "center",
marginBottom: theme.spacing(1),
}));

export const Content = styled(Paper)(({ theme }) => ({
padding: theme.spacing(2),
boxSizing: "border-box",
flex: 1,
width: "100%",
display: "flex",
flexFlow: "column nowrap",
justifyContent: "flex-start",
alignItems: "flex-start",
overflow: "auto",
position: "relative",
}));

0 comments on commit a1aac53

Please sign in to comment.