Skip to content

Commit 89e4082

Browse files
committed
Adjusting color usage so that they reflect the theme
1 parent f6a599f commit 89e4082

File tree

4 files changed

+52
-59
lines changed

4 files changed

+52
-59
lines changed

src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ function App() {
4242
<TestRunProvider>
4343
<SocketProvider>
4444
<HelpProvider>
45-
<Box sx={{ height: "10%" }}>
45+
<Box sx={{ height: "10%", bgcolor: theme.palette.background.paper }}>
4646
<Header />
4747
</Box>
48-
<Box sx={{ height: "90%" }}>
48+
<Box sx={{ height: "90%", bgcolor: theme.palette.background.default }}>
4949
<Router />
5050
</Box>
5151
</HelpProvider>

src/components/TestDetailsDialog/DrawArea.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,14 @@ import React, { FunctionComponent, useCallback } from "react";
33
import { Stage, Layer, Image } from "react-konva";
44
import Rectangle, { MIN_RECT_SIDE_PIXEL } from "../Rectangle";
55
import { IgnoreArea } from "../../types/ignoreArea";
6-
import { Grid, CircularProgress, type Theme } from "@mui/material";
6+
import { Grid, CircularProgress } from "@mui/material";
77
import { NoImagePlaceholder } from "./NoImageAvailable";
88
import Konva from "konva";
99
import { makeStyles } from "@mui/styles";
1010

11-
const useStyles = makeStyles((theme: Theme) => ({
11+
const useStyles = makeStyles(() => ({
1212
canvasContainer: {
1313
overflow: "auto",
14-
backgroundColor: "white",
15-
},
16-
imageDetailsContainer: {
17-
position: "absolute",
18-
backgroundColor: "white",
19-
zIndex: 1,
20-
padding: theme.spacing(1),
21-
height: "48px",
2214
},
2315
progressContainer: {
2416
minHeight: "300px",

src/components/TestDetailsDialog/ImageDetails.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const useStyles = makeStyles(() => ({
99
container: {
1010
display: "flex",
1111
alignItems: "center",
12-
color: "darkslategrey",
1312
},
1413
branchName: {
1514
cursor: "pointer",
@@ -45,7 +44,7 @@ const ImageDetails: React.FunctionComponent<ImageDetailsProps> = ({
4544
imageName && (
4645
<Typography
4746
variant="caption"
48-
style={{ marginRight: 3, fontSize: "0.7rem" }}
47+
sx={{mr: 0.5, fontSize: "0.7rem"}}
4948
data-testid="image-size"
5049
>
5150
{image ? `(${image?.width} x ${image?.height})` : "Loading..."}
@@ -55,7 +54,7 @@ const ImageDetails: React.FunctionComponent<ImageDetailsProps> = ({
5554
};
5655
return (
5756
<Grid item className={classes.container}>
58-
<Typography variant="overline" style={{ marginRight: 3 }}>
57+
<Typography variant="overline" sx={{mr: 0.5}}>
5958
{type === "Baseline" ? "Baseline" : "Checkpoint"}
6059
</Typography>
6160
{imageSize()}

src/components/TestDetailsDialog/TestDetailsModal.tsx

Lines changed: 46 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import {
3838
NavigateNext,
3939
NavigateBefore,
4040
} from "@mui/icons-material";
41+
import { useTheme } from '@mui/material/styles';
4142
import { TestRunDetails } from "./TestRunDetails";
4243
import useImage from "use-image";
4344
import { routes } from "../../constants";
@@ -53,50 +54,6 @@ import ImageDetails, { ImageDetailsProps } from "./ImageDetails";
5354
import { calculateScale } from "../../_helpers/scale.helper";
5455
import TestStatusChip from "../TestStatusChip";
5556

56-
const useStyles = makeStyles(() => ({
57-
header: {
58-
position: "relative",
59-
textAlign: "left",
60-
background: "#efefef",
61-
paddingLeft: 8,
62-
paddingBottom: 8,
63-
},
64-
footer: {
65-
background: "#efefef",
66-
},
67-
scaleActions: {
68-
display: "flex",
69-
alignItems: "center",
70-
},
71-
testRunActions: {
72-
display: "flex",
73-
alignItems: "center",
74-
alignContent: "center",
75-
},
76-
testRunName: {
77-
fontWeight: 300,
78-
},
79-
closeIcon: {
80-
position: "absolute",
81-
right: "8px",
82-
},
83-
testRunDetails: {
84-
paddingLeft: 8,
85-
},
86-
drawAreaContainer: {
87-
width: "100%",
88-
height: "100%",
89-
},
90-
drawAreaItem: {
91-
padding: "0 4px",
92-
height: "100%",
93-
},
94-
imageToolbar: {
95-
paddingLeft: 5,
96-
height: 52,
97-
},
98-
}));
99-
10057
const defaultStagePos = {
10158
x: 0,
10259
y: 0,
@@ -121,6 +78,51 @@ const TestDetailsModal: React.FunctionComponent<TestDetailsModalProps> = ({
12178
handleNext,
12279
handleClose,
12380
}) => {
81+
82+
const theme = useTheme();
83+
const useStyles = makeStyles(() => ({
84+
header: {
85+
position: "relative",
86+
textAlign: "left",
87+
background: theme.palette.divider,
88+
paddingLeft: 8,
89+
paddingBottom: 8,
90+
},
91+
footer: {
92+
background: theme.palette.divider,
93+
},
94+
scaleActions: {
95+
display: "flex",
96+
alignItems: "center",
97+
},
98+
testRunActions: {
99+
display: "flex",
100+
alignItems: "center",
101+
alignContent: "center",
102+
},
103+
testRunName: {
104+
fontWeight: 300,
105+
},
106+
closeIcon: {
107+
position: "absolute",
108+
right: "8px",
109+
},
110+
testRunDetails: {
111+
paddingLeft: 8,
112+
},
113+
drawAreaContainer: {
114+
width: "100%",
115+
height: "100%",
116+
},
117+
drawAreaItem: {
118+
padding: "0 4px",
119+
height: "100%",
120+
},
121+
imageToolbar: {
122+
paddingLeft: 5,
123+
height: 52,
124+
},
125+
}));
124126
const classes = useStyles();
125127
const { enqueueSnackbar } = useSnackbar();
126128
const testRunDispatch = useTestRunDispatch();

0 commit comments

Comments
 (0)