Skip to content

Commit 01bdcd6

Browse files
committed
emotion: InfoTooltip
1 parent 20b1b73 commit 01bdcd6

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

site/src/components/InfoTooltip/InfoTooltip.tsx

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
HelpTooltipTitle,
66
} from "components/HelpTooltip/HelpTooltip";
77
import InfoIcon from "@mui/icons-material/InfoOutlined";
8-
import { makeStyles } from "@mui/styles";
8+
import { css } from "@emotion/css";
99
import { colors } from "theme/colors";
1010

1111
interface InfoTooltipProps {
@@ -17,31 +17,22 @@ interface InfoTooltipProps {
1717
export const InfoTooltip: FC<InfoTooltipProps> = (props) => {
1818
const { title, message, type = "info" } = props;
1919

20-
const styles = useStyles({ type });
21-
2220
return (
2321
<HelpTooltip
2422
size="small"
2523
icon={InfoIcon}
26-
iconClassName={styles.icon}
27-
buttonClassName={styles.button}
24+
iconClassName={css`
25+
color: ${type === "info" ? colors.blue[5] : colors.yellow[5]};
26+
`}
27+
buttonClassName={css`
28+
opacity: 1;
29+
&:hover {
30+
opacity: 1;
31+
}
32+
`}
2833
>
2934
<HelpTooltipTitle>{title}</HelpTooltipTitle>
3035
<HelpTooltipText>{message}</HelpTooltipText>
3136
</HelpTooltip>
3237
);
3338
};
34-
35-
const useStyles = makeStyles<unknown, Pick<InfoTooltipProps, "type">>(() => ({
36-
icon: ({ type }) => ({
37-
color: type === "info" ? colors.blue[5] : colors.yellow[5],
38-
}),
39-
40-
button: {
41-
opacity: 1,
42-
43-
"&:hover": {
44-
opacity: 1,
45-
},
46-
},
47-
}));

0 commit comments

Comments
 (0)