File tree Expand file tree Collapse file tree 1 file changed +15
-27
lines changed
site/src/components/Typography Expand file tree Collapse file tree 1 file changed +15
-27
lines changed Original file line number Diff line number Diff line change 3
3
* verbatim port from `@coder/ui`.
4
4
*/
5
5
6
- import { makeStyles } from "@mui/styles" ;
7
6
import MuiTypography , {
8
7
TypographyProps as MuiTypographyProps ,
9
8
} from "@mui/material/Typography" ;
10
9
import * as React from "react" ;
11
- import { appendCSSString , combineClasses } from "utils/combineClasses" ;
12
10
13
11
export interface TypographyProps extends MuiTypographyProps {
14
12
short ?: boolean ;
@@ -20,29 +18,19 @@ export interface TypographyProps extends MuiTypographyProps {
20
18
*
21
19
* See original component's Material UI documentation here: https://material-ui.com/components/typography/
22
20
*/
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
+ ) ;
36
36
} ;
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
- } ) ;
You can’t perform that action at this time.
0 commit comments