Skip to content

Commit 36af836

Browse files
committed
🧹
1 parent 14dcfc8 commit 36af836

File tree

3 files changed

+29
-38
lines changed

3 files changed

+29
-38
lines changed

site/src/components/Stats/Stats.tsx

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,28 @@
1-
import Box from "@mui/material/Box"
2-
import { makeStyles } from "@mui/styles"
3-
import { ComponentProps, FC, PropsWithChildren } from "react"
4-
import { combineClasses } from "utils/combineClasses"
1+
import { type CSSObject, type Interpolation, type Theme } from "@emotion/react";
2+
import Box from "@mui/material/Box";
3+
import { type ComponentProps, type FC } from "react";
54

65
export const Stats: FC<ComponentProps<typeof Box>> = (props) => {
7-
const styles = useStyles()
8-
return (
9-
<Box
10-
{...props}
11-
className={combineClasses([styles.stats, props.className])}
12-
/>
13-
)
14-
}
6+
return <Box {...props} css={styles.stats} />;
7+
};
158

169
export const StatsItem: FC<
1710
{
18-
label: string
19-
value: string | number | JSX.Element
11+
label: string;
12+
value: string | number | JSX.Element;
2013
} & ComponentProps<typeof Box>
2114
> = ({ label, value, ...divProps }) => {
22-
const styles = useStyles()
23-
2415
return (
25-
<Box
26-
{...divProps}
27-
className={combineClasses([styles.statItem, divProps.className])}
28-
>
29-
<span className={styles.statsLabel}>{label}:</span>
30-
<span className={styles.statsValue}>{value}</span>
16+
<Box {...divProps} css={styles.statItem}>
17+
<span css={styles.statsLabel}>{label}:</span>
18+
<span css={styles.statsValue}>{value}</span>
3119
</Box>
32-
)
33-
}
20+
);
21+
};
3422

35-
const useStyles = makeStyles((theme) => ({
36-
stats: {
37-
...theme.typography.body2,
23+
const styles = {
24+
stats: (theme) => ({
25+
...(theme.typography.body2 as CSSObject),
3826
paddingLeft: theme.spacing(2),
3927
paddingRight: theme.spacing(2),
4028
borderRadius: theme.shape.borderRadius,
@@ -49,9 +37,9 @@ const useStyles = makeStyles((theme) => ({
4937
display: "block",
5038
padding: theme.spacing(2),
5139
},
52-
},
40+
}),
5341

54-
statItem: {
42+
statItem: (theme) => ({
5543
padding: theme.spacing(1.75),
5644
paddingLeft: theme.spacing(2),
5745
paddingRight: theme.spacing(2),
@@ -62,14 +50,14 @@ const useStyles = makeStyles((theme) => ({
6250
[theme.breakpoints.down("md")]: {
6351
padding: theme.spacing(1),
6452
},
65-
},
53+
}),
6654

6755
statsLabel: {
6856
display: "block",
6957
wordWrap: "break-word",
7058
},
7159

72-
statsValue: {
60+
statsValue: (theme) => ({
7361
marginTop: theme.spacing(0.25),
7462
display: "flex",
7563
wordWrap: "break-word",
@@ -85,5 +73,5 @@ const useStyles = makeStyles((theme) => ({
8573
textDecoration: "underline",
8674
},
8775
},
88-
},
89-
}))
76+
}),
77+
} satisfies Record<string, Interpolation<Theme>>;

site/src/components/WorkspaceBuildLogs/Logs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const Logs: FC<React.PropsWithChildren<LogsProps>> = ({
2727
<div css={styles.root} className={className}>
2828
<div css={styles.scrollWrapper}>
2929
{lines.map((line, idx) => (
30-
<div css={[styles.line, line.level]} key={idx}>
30+
<div css={styles.line} className={line.level} key={idx}>
3131
{!hideTimestamps && (
3232
<>
3333
<span css={styles.time}>

site/src/pages/DeploySettingsPage/AppearanceSettingsPage/AppearanceSettingsPageView.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { useFormik } from "formik";
2020
import Link from "@mui/material/Link";
2121
import { colors } from "theme/colors";
2222
import { hslToHex } from "utils/colors";
23+
import { useTheme } from "@emotion/react";
2324

2425
export type AppearanceSettingsPageViewProps = {
2526
appearance: UpdateAppearanceConfig;
@@ -37,6 +38,8 @@ export const AppearanceSettingsPageView = ({
3738
isEntitled,
3839
onSaveAppearance,
3940
}: AppearanceSettingsPageViewProps): JSX.Element => {
41+
const theme = useTheme();
42+
4043
const applicationNameForm = useFormik<{
4144
application_name: string;
4245
}>({
@@ -130,14 +133,14 @@ export const AppearanceSettingsPageView = ({
130133
endAdornment: (
131134
<InputAdornment
132135
position="end"
133-
css={(theme) => ({
136+
css={{
134137
width: theme.spacing(3),
135138
height: theme.spacing(3),
136139

137140
"& img": {
138141
maxWidth: "100%",
139142
},
140-
})}
143+
}}
141144
>
142145
<img
143146
alt=""
@@ -246,7 +249,7 @@ export const AppearanceSettingsPageView = ({
246249
}}
247250
triangle="hide"
248251
colors={["#004852", "#D65D0F", "#4CD473", "#D94A5D", "#5A00CF"]}
249-
css={(theme) => ({
252+
styles={{
250253
default: {
251254
input: {
252255
color: "white",
@@ -260,7 +263,7 @@ export const AppearanceSettingsPageView = ({
260263
backgroundColor: "black",
261264
},
262265
},
263-
})}
266+
}}
264267
/>
265268
</Stack>
266269
</Stack>

0 commit comments

Comments
 (0)