Skip to content

Commit 66a9d75

Browse files
committed
Run prettier
1 parent 60927d8 commit 66a9d75

3 files changed

Lines changed: 72 additions & 66 deletions

File tree

src/snapshots-app/client/bundles/components/submission/tabs/timeline/BasicFileViewer.jsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ import Editor from "@monaco-editor/react";
55
import "./FileViewer.css";
66

77
function BasicFileViewer({ code, language, lightMode, editorRef }) {
8-
9-
108
return (
119
<>
1210
<Editor
13-
onMount={(editor) => {
14-
editorRef.current = editor;
15-
}}
11+
onMount={(editor) => {
12+
editorRef.current = editor;
13+
}}
1614
defaultLanguage={language}
1715
defaultValue={code}
1816
theme={lightMode ? "light" : "vs-dark"}

src/snapshots-app/client/bundles/components/submission/tabs/timeline/DiffViewer.jsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ function DiffViewer({
2323
lightMode = false,
2424
renderSideBySide = false,
2525
}) {
26-
2726
const onDiffEditorMount = (editor, monaco) => {
2827
editorRef.current = editor;
2928

@@ -95,13 +94,13 @@ function DiffViewer({
9594
scrollBeyondLastLine: false,
9695
renderSideBySide: renderSideBySide,
9796
// Enable the auto-collapse feature
98-
hideUnchangedRegions: {
99-
enabled: true,
100-
contextLineCount: 5, // Lines of unchanged code to show around a diff
101-
minimumLineCount: 3, // Minimum unchanged lines required to trigger a collapse
102-
// TODO this isn't working properly
103-
revealLineCount: 20, // How many lines to reveal when clicking the "expand" button
104-
},
97+
hideUnchangedRegions: {
98+
enabled: true,
99+
contextLineCount: 5, // Lines of unchanged code to show around a diff
100+
minimumLineCount: 3, // Minimum unchanged lines required to trigger a collapse
101+
// TODO this isn't working properly
102+
revealLineCount: 20, // How many lines to reveal when clicking the "expand" button
103+
},
105104
}}
106105
/>
107106
</>

src/snapshots-app/client/bundles/components/submission/tabs/timeline/Graphs.jsx

Lines changed: 62 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ import ErrorOutlineIcon from "@mui/icons-material/ErrorOutline";
66
import { Tooltip } from "@mui/material";
77
import Typography from "@mui/material/Typography";
88
import Box from "@mui/material/Box";
9-
import { Link } from '@mui/material';
10-
import { List, ListItem } from '@mui/material';
11-
9+
import { Link } from "@mui/material";
10+
import { List, ListItem } from "@mui/material";
1211

1312
function LinearProgressWithLabel(props) {
1413
return (
@@ -53,14 +52,14 @@ const ProblemJumpLink = ({ lineNumber, editorRef, label }) => {
5352
variant="body2"
5453
onClick={handleJump}
5554
sx={{
56-
textAlign: 'left',
57-
verticalAlign: 'baseline',
58-
textDecoration: 'none',
59-
'&:hover': {
60-
textDecoration: 'underline',
55+
textAlign: "left",
56+
verticalAlign: "baseline",
57+
textDecoration: "none",
58+
"&:hover": {
59+
textDecoration: "underline",
6160
},
62-
cursor: 'pointer',
63-
color: 'primary.main',
61+
cursor: "pointer",
62+
color: "primary.main",
6463
fontWeight: 500,
6564
}}
6665
>
@@ -69,7 +68,6 @@ const ProblemJumpLink = ({ lineNumber, editorRef, label }) => {
6968
);
7069
};
7170

72-
7371
function AssignmentProblems({
7472
history,
7573
allProblemDisplayNames,
@@ -115,59 +113,70 @@ function AssignmentProblems({
115113
return (numSolved / allProblemDisplayNames.length) * 100;
116114
}
117115

118-
119116
// TODO span styling and improve accessibility?
120117
const problems = allProblemDisplayNames.map((problemDisplayName) => {
121118
const lines = problemLines[problemDisplayName];
122119

123120
if (problemLines[problemDisplayName].length === 0) {
124121
return (
125-
<Box key={problemDisplayName} sx={{ display: 'flex', alignItems: 'center', my: 0.5 }}>
126-
{getIcon(problemDisplayName)}
127-
<Typography variant="body2" sx={{ ml: 1, color: 'text.disabled' }}>
128-
{problemDisplayName} (Not found)
129-
</Typography>
130-
</Box>
131-
);
122+
<Box
123+
key={problemDisplayName}
124+
sx={{ display: "flex", alignItems: "center", my: 0.5 }}
125+
>
126+
{getIcon(problemDisplayName)}
127+
<Typography variant="body2" sx={{ ml: 1, color: "text.disabled" }}>
128+
{problemDisplayName} (Not found)
129+
</Typography>
130+
</Box>
131+
);
132132
} else if (problemLines[problemDisplayName].length === 1) {
133133
return (
134-
<Box key={problemDisplayName} sx={{ display: 'flex', alignItems: 'center', my: 0.5 }}>
135-
{getIcon(problemDisplayName)}
136-
<Box sx={{ ml: 1 }}>
137-
<ProblemJumpLink
138-
lineNumber={lines[0]}
139-
editorRef={editorRef}
140-
label={problemDisplayName}
141-
/>
134+
<Box
135+
key={problemDisplayName}
136+
sx={{ display: "flex", alignItems: "center", my: 0.5 }}
137+
>
138+
{getIcon(problemDisplayName)}
139+
<Box sx={{ ml: 1 }}>
140+
<ProblemJumpLink
141+
lineNumber={lines[0]}
142+
editorRef={editorRef}
143+
label={problemDisplayName}
144+
/>
145+
</Box>
142146
</Box>
143-
</Box>
144-
);
147+
);
145148
} else {
146149
return (
147-
<Box key={problemDisplayName} sx={{ my: 1 }}>
148-
<Box sx={{ display: 'flex', alignItems: 'center' }}>
149-
{getIcon(problemDisplayName)}
150-
<Typography variant="body2" sx={{ ml: 1 }}>
151-
{problemDisplayName}
152-
</Typography>
153-
</Box>
154-
<Box sx={{ pl: 4, display: 'flex', flexDirection: 'column', flexWrap: 'wrap' }}>
155-
156-
<List sx={{ listStyleType: 'disc', pl: '1rem' }}>
157-
{lines.map((lineNumber) => (
158-
<ListItem disablePadding sx={{ display: 'list-item' }}>
159-
<ProblemJumpLink
160-
key={`${problemDisplayName}-${lineNumber}`}
161-
lineNumber={lineNumber}
162-
editorRef={editorRef}
163-
label={`Line ${lineNumber}`}
164-
/>
165-
</ListItem>
166-
))}
167-
</List>
168-
</Box>
169-
</Box>
170-
);
150+
<Box key={problemDisplayName} sx={{ my: 1 }}>
151+
<Box sx={{ display: "flex", alignItems: "center" }}>
152+
{getIcon(problemDisplayName)}
153+
<Typography variant="body2" sx={{ ml: 1 }}>
154+
{problemDisplayName}
155+
</Typography>
156+
</Box>
157+
<Box
158+
sx={{
159+
pl: 4,
160+
display: "flex",
161+
flexDirection: "column",
162+
flexWrap: "wrap",
163+
}}
164+
>
165+
<List sx={{ listStyleType: "disc", pl: "1rem" }}>
166+
{lines.map((lineNumber) => (
167+
<ListItem disablePadding sx={{ display: "list-item" }}>
168+
<ProblemJumpLink
169+
key={`${problemDisplayName}-${lineNumber}`}
170+
lineNumber={lineNumber}
171+
editorRef={editorRef}
172+
label={`Line ${lineNumber}`}
173+
/>
174+
</ListItem>
175+
))}
176+
</List>
177+
</Box>
178+
</Box>
179+
);
171180
}
172181
});
173182

0 commit comments

Comments
 (0)