Skip to content

Commit f098d2f

Browse files
committed
emotion: ChartSection
1 parent cde4189 commit f098d2f

File tree

1 file changed

+35
-29
lines changed

1 file changed

+35
-29
lines changed

site/src/pages/DeploySettingsPage/GeneralSettingsPage/ChartSection.tsx

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
import { useTheme } from "@emotion/react";
12
import Paper from "@mui/material/Paper";
2-
import { makeStyles } from "@mui/styles";
3-
import { HTMLProps, ReactNode, FC, PropsWithChildren } from "react";
4-
import { combineClasses } from "utils/combineClasses";
3+
import {
4+
type HTMLProps,
5+
type ReactNode,
6+
type FC,
7+
type PropsWithChildren,
8+
} from "react";
59

610
export interface ChartSectionProps {
711
/**
@@ -18,44 +22,46 @@ export const ChartSection: FC<PropsWithChildren<ChartSectionProps>> = ({
1822
contentsProps,
1923
title,
2024
}) => {
21-
const styles = useStyles();
25+
const theme = useTheme();
2226

2327
return (
24-
<Paper className={styles.root} elevation={0}>
28+
<Paper
29+
css={{
30+
border: `1px solid ${theme.palette.divider}`,
31+
borderRadius: theme.shape.borderRadius,
32+
}}
33+
elevation={0}
34+
>
2535
{title && (
26-
<div className={styles.header}>
27-
<h6 className={styles.title}>{title}</h6>
36+
<div
37+
css={{
38+
alignItems: "center",
39+
display: "flex",
40+
justifyContent: "space-between",
41+
padding: theme.spacing(1.5, 2),
42+
}}
43+
>
44+
<h6
45+
css={{
46+
margin: 0,
47+
fontSize: 14,
48+
fontWeight: 600,
49+
}}
50+
>
51+
{title}
52+
</h6>
2853
{action && <div>{action}</div>}
2954
</div>
3055
)}
3156

3257
<div
3358
{...contentsProps}
34-
className={combineClasses([styles.contents, contentsProps?.className])}
59+
css={{
60+
margin: theme.spacing(2),
61+
}}
3562
>
3663
{children}
3764
</div>
3865
</Paper>
3966
);
4067
};
41-
42-
const useStyles = makeStyles((theme) => ({
43-
root: {
44-
border: `1px solid ${theme.palette.divider}`,
45-
borderRadius: theme.shape.borderRadius,
46-
},
47-
contents: {
48-
margin: theme.spacing(2),
49-
},
50-
header: {
51-
alignItems: "center",
52-
display: "flex",
53-
justifyContent: "space-between",
54-
padding: theme.spacing(1.5, 2),
55-
},
56-
title: {
57-
margin: 0,
58-
fontSize: 14,
59-
fontWeight: 600,
60-
},
61-
}));

0 commit comments

Comments
 (0)