1
1
import Button from "@mui/material/Button" ;
2
- import { makeStyles } from "@mui/styles" ;
3
2
import LaunchOutlined from "@mui/icons-material/LaunchOutlined" ;
3
+ import type { FC } from "react" ;
4
+ import { useTheme } from "@emotion/react" ;
4
5
import { Stack } from "components/Stack/Stack" ;
5
- import { FC } from "react" ;
6
6
7
7
export const Header : FC < {
8
8
title : string | JSX . Element ;
9
9
description ?: string | JSX . Element ;
10
10
secondary ?: boolean ;
11
11
docsHref ?: string ;
12
12
} > = ( { title, description, docsHref, secondary } ) => {
13
- const styles = useStyles ( ) ;
13
+ const theme = useTheme ( ) ;
14
14
15
15
return (
16
16
< Stack alignItems = "baseline" direction = "row" justifyContent = "space-between" >
17
- < div className = { styles . headingGroup } >
18
- < h1 className = { `${ styles . title } ${ secondary ? "secondary" : "" } ` } >
17
+ < div css = { { maxWidth : 420 , marginBottom : theme . spacing ( 3 ) } } >
18
+ < h1
19
+ css = { [
20
+ {
21
+ fontSize : 32 ,
22
+ fontWeight : 700 ,
23
+ display : "flex" ,
24
+ alignItems : "center" ,
25
+ lineHeight : "initial" ,
26
+ margin : 0 ,
27
+ marginBottom : theme . spacing ( 0.5 ) ,
28
+ gap : theme . spacing ( 1 ) ,
29
+ } ,
30
+ secondary && {
31
+ fontSize : 24 ,
32
+ fontWeight : 500 ,
33
+ } ,
34
+ ] }
35
+ >
19
36
{ title }
20
37
</ h1 >
21
38
{ description && (
22
- < span className = { styles . description } > { description } </ span >
39
+ < span
40
+ css = { {
41
+ fontSize : 14 ,
42
+ color : theme . palette . text . secondary ,
43
+ lineHeight : "160%" ,
44
+ } }
45
+ >
46
+ { description }
47
+ </ span >
23
48
) }
24
49
</ div >
25
50
@@ -36,32 +61,3 @@ export const Header: FC<{
36
61
</ Stack >
37
62
) ;
38
63
} ;
39
-
40
- const useStyles = makeStyles ( ( theme ) => ( {
41
- headingGroup : {
42
- maxWidth : 420 ,
43
- marginBottom : theme . spacing ( 3 ) ,
44
- } ,
45
-
46
- title : {
47
- fontSize : 32 ,
48
- fontWeight : 700 ,
49
- display : "flex" ,
50
- alignItems : "center" ,
51
- lineHeight : "initial" ,
52
- margin : 0 ,
53
- marginBottom : theme . spacing ( 0.5 ) ,
54
- gap : theme . spacing ( 1 ) ,
55
-
56
- "&.secondary" : {
57
- fontSize : 24 ,
58
- fontWeight : 500 ,
59
- } ,
60
- } ,
61
-
62
- description : {
63
- fontSize : 14 ,
64
- color : theme . palette . text . secondary ,
65
- lineHeight : "160%" ,
66
- } ,
67
- } ) ) ;
0 commit comments