Skip to content

Commit

Permalink
Update breakpoints for heighs to use as much vertical space as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
wniestroj committed Nov 26, 2024
1 parent d683425 commit 84d4617
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend-v2/src/features/trial/Doses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import FloatField from "../../components/FloatField";
import IntegerField from "../../components/IntegerField";
import useDirty from "../../hooks/useDirty";
import useInterval from "../../hooks/useInterval";
import HelpButton from "../../components/HelpButton";
import { useSelector } from "react-redux";
import { RootState } from "../../app/store";
import { selectIsProjectShared } from "../login/loginSlice";
import { TableHeader } from "../../components/TableHeader";
import HelpOutlineIcon from "@mui/icons-material/HelpOutline";

interface Props {
onChange: () => void;
project: ProjectRead;
Expand Down
38 changes: 33 additions & 5 deletions frontend-v2/src/features/trial/Protocols.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import {
Tabs,
Tab,
IconButton,
Stack,
} from "@mui/material";
import Add from "@mui/icons-material/Add";
import Error from "@mui/icons-material/Error";
import {
useCombinedModelListQuery,
Expand All @@ -35,10 +33,40 @@ import useSubjectGroups from "../../hooks/useSubjectGroups";
import { TableHeader } from "../../components/TableHeader";
import RemoveCircleOutlineIcon from "@mui/icons-material/RemoveCircleOutline";
import {
getTableHeight,
SINGLE_TABLE_BREAKPOINTS,
getTableHeight
} from "../../shared/calculateTableHeights";

const TABLE_BREAKPOINTS = [
{
minHeight: 1100,
tableHeight: "78vh",
},
{
minHeight: 1000,
tableHeight: "75vh",
},
{
minHeight: 900,
tableHeight: "72vh",
},
{
minHeight: 800,
tableHeight: "68vh",
},
{
minHeight: 700,
tableHeight: "67vh",
},
{
minHeight: 600,
tableHeight: "60vh",
},
{
minHeight: 500,
tableHeight: "60vh",
},
];

const Protocols: FC = () => {
const [tab, setTab] = useState(0);
const selectedProject = useSelector(
Expand Down Expand Up @@ -240,7 +268,7 @@ const Protocols: FC = () => {
<Box role="tabpanel" id={`group-tabpanel`}>
<TableContainer
sx={{
height: getTableHeight({ steps: SINGLE_TABLE_BREAKPOINTS }),
height: getTableHeight({ steps: TABLE_BREAKPOINTS }),
}}
>
<Table stickyHeader>
Expand Down

0 comments on commit 84d4617

Please sign in to comment.