Skip to content

Commit 7192a6c

Browse files
authored
make sim review page more responsive (#80)
1 parent c04f22b commit 7192a6c

File tree

2 files changed

+45
-18
lines changed

2 files changed

+45
-18
lines changed

web-conexs-client/src/components/SimulationReviewPage.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { useNavigate } from "react-router-dom";
1919
import NavigateNextIcon from "@mui/icons-material/NavigateNext";
2020
import NavigateBeforeIcon from "@mui/icons-material/NavigateBefore";
2121

22+
2223
export default function SimulationReviewPage() {
2324
const [cursor, setCursor] = useState<string | null>(null);
2425
const [next, setNext] = useState<string | null>(null);
@@ -65,11 +66,15 @@ export default function SimulationReviewPage() {
6566
alignItems="center"
6667
margin="5px 20px"
6768
>
68-
<Typography variant="h5" component="div">
69+
<Typography
70+
variant="h5"
71+
component="div"
72+
fontSize={{ xs: "1rem", sm: "1.25rem", md: "1.5rem" }}
73+
>
6974
Simulation Results
7075
</Typography>
7176
<Button variant="contained" onClick={handleClickOpen}>
72-
Download All
77+
Download
7378
</Button>
7479
<Dialog
7580
open={open}

web-conexs-client/src/components/SimulationTable.tsx

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ import {
99
TableBody,
1010
Box,
1111
Typography,
12-
Button,
1312
useMediaQuery,
1413
Tooltip,
14+
IconButton,
1515
} from "@mui/material";
1616

17+
import CancelIcon from "@mui/icons-material/Cancel";
18+
1719
import { tableCellClasses } from "@mui/material/TableCell";
1820

1921
import { styled, useTheme } from "@mui/material/styles";
@@ -122,24 +124,37 @@ function SimulationMetadata(props: {
122124
overflow: "hidden",
123125
}}
124126
>
125-
{structLabel}
127+
{props.compact
128+
? structLabel
129+
: props.simulation?.chemical_structure.id}
126130
</StyledTableCell>
127131
</Tooltip>
128-
<StyledTableCell align="center" onClick={clickCell}>
132+
<StyledTableCell
133+
sx={{
134+
maxWidth: "50px",
135+
textOverflow: "ellipsis",
136+
whiteSpace: "nowrap",
137+
overflow: "hidden",
138+
}}
139+
align="center"
140+
onClick={clickCell}
141+
>
129142
<Typography color={color}> {props.simulation?.status ?? ""}</Typography>
130143
</StyledTableCell>
131144
{props.compact && (
132-
<StyledTableCell align="center" onClick={clickCell}>
133-
{request_string}
134-
</StyledTableCell>
145+
<>
146+
<StyledTableCell align="center" onClick={clickCell}>
147+
{request_string}
148+
</StyledTableCell>
149+
<StyledTableCell align="center" onClick={clickCell}>
150+
{complete_string}
151+
</StyledTableCell>
152+
</>
135153
)}
136-
137-
<StyledTableCell align="center" onClick={clickCell}>
138-
{complete_string}
139-
</StyledTableCell>
140154
<StyledTableCell align="left">
141155
{showCancel && (
142-
<Button
156+
<IconButton
157+
color="error"
143158
size="small"
144159
onClick={() => {
145160
if (props.simulation != null) {
@@ -148,8 +163,8 @@ function SimulationMetadata(props: {
148163
}}
149164
variant="contained"
150165
>
151-
Cancel
152-
</Button>
166+
<CancelIcon fontSize="small" />
167+
</IconButton>
153168
)}
154169
</StyledTableCell>
155170
</StyledTableRow>
@@ -189,11 +204,18 @@ export default function SimulationTable(props: {
189204
<TableRow>
190205
<TableCell align="left">ID</TableCell>
191206
<TableCell align="left">Type</TableCell>
192-
<TableCell align="left">Structure</TableCell>
207+
<TableCell align="left">
208+
{" "}
209+
{matches ? "Structure" : "Struct."}
210+
</TableCell>
193211
<TableCell align="center">Status</TableCell>
194-
{matches && <TableCell align="center">Request Date</TableCell>}
212+
{matches && (
213+
<>
214+
<TableCell align="center">Request Date</TableCell>
215+
<TableCell align="center">Completion Date</TableCell>
216+
</>
217+
)}
195218

196-
<TableCell align="center">Completion Date</TableCell>
197219
<TableCell align="left"></TableCell>
198220
</TableRow>
199221
</TableHead>

0 commit comments

Comments
 (0)