Skip to content

Commit d597c7b

Browse files
committed
emotion: Typography
1 parent 4e48356 commit d597c7b

File tree

1 file changed

+15
-27
lines changed

1 file changed

+15
-27
lines changed

site/src/components/Typography/Typography.tsx

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
* verbatim port from `@coder/ui`.
44
*/
55

6-
import { makeStyles } from "@mui/styles";
76
import MuiTypography, {
87
TypographyProps as MuiTypographyProps,
98
} from "@mui/material/Typography";
109
import * as React from "react";
11-
import { appendCSSString, combineClasses } from "utils/combineClasses";
1210

1311
export interface TypographyProps extends MuiTypographyProps {
1412
short?: boolean;
@@ -20,29 +18,19 @@ export interface TypographyProps extends MuiTypographyProps {
2018
*
2119
* See original component's Material UI documentation here: https://material-ui.com/components/typography/
2220
*/
23-
export const Typography: React.FC<TypographyProps> = ({
24-
className,
25-
short,
26-
...rest
27-
}) => {
28-
const styles = useStyles();
29-
30-
let classes = combineClasses({ [styles.short]: short });
31-
if (className) {
32-
classes = appendCSSString(classes ?? "", className);
33-
}
34-
35-
return <MuiTypography {...rest} className={classes} />;
21+
export const Typography: React.FC<TypographyProps> = ({ short, ...attrs }) => {
22+
return (
23+
<MuiTypography
24+
css={{
25+
"&.MuiTypography-body1": {
26+
lineHeight: "21px",
27+
},
28+
"&.MuiTypography-body2": {
29+
lineHeight: "18px",
30+
letterSpacing: 0.2,
31+
},
32+
}}
33+
{...attrs}
34+
/>
35+
);
3636
};
37-
38-
const useStyles = makeStyles({
39-
short: {
40-
"&.MuiTypography-body1": {
41-
lineHeight: "21px",
42-
},
43-
"&.MuiTypography-body2": {
44-
lineHeight: "18px",
45-
letterSpacing: 0.2,
46-
},
47-
},
48-
});

0 commit comments

Comments
 (0)