1
+ import type { FC } from "react" ;
2
+ import { useTheme } from "@emotion/react" ;
1
3
import { Avatar } from "components/Avatar/Avatar" ;
2
- import { FC } from "react" ;
3
4
import { Stack } from "components/Stack/Stack" ;
4
- import { makeStyles } from "@mui/styles" ;
5
5
6
6
export interface AvatarDataProps {
7
7
title : string | JSX . Element ;
@@ -16,7 +16,7 @@ export const AvatarData: FC<AvatarDataProps> = ({
16
16
src,
17
17
avatar,
18
18
} ) => {
19
- const styles = useStyles ( ) ;
19
+ const theme = useTheme ( ) ;
20
20
21
21
if ( ! avatar ) {
22
22
avatar = < Avatar src = { src } > { title } </ Avatar > ;
@@ -27,38 +27,41 @@ export const AvatarData: FC<AvatarDataProps> = ({
27
27
spacing = { 1.5 }
28
28
direction = "row"
29
29
alignItems = "center"
30
- className = { styles . root }
30
+ css = { {
31
+ minHeight : theme . spacing ( 5 ) , // Make it predictable for the skeleton
32
+ width : "100%" ,
33
+ lineHeight : "150%" ,
34
+ } }
31
35
>
32
36
{ avatar }
33
37
34
- < Stack spacing = { 0 } className = { styles . info } >
35
- < span className = { styles . title } > { title } </ span >
36
- { subtitle && < span className = { styles . subtitle } > { subtitle } </ span > }
38
+ < Stack
39
+ spacing = { 0 }
40
+ css = { {
41
+ width : "100%" ,
42
+ } }
43
+ >
44
+ < span
45
+ css = { {
46
+ color : theme . palette . text . primary ,
47
+ fontWeight : 600 ,
48
+ } }
49
+ >
50
+ { title }
51
+ </ span >
52
+ { subtitle && (
53
+ < span
54
+ css = { {
55
+ fontSize : 12 ,
56
+ color : theme . palette . text . secondary ,
57
+ lineHeight : "150%" ,
58
+ maxWidth : 540 ,
59
+ } }
60
+ >
61
+ { subtitle }
62
+ </ span >
63
+ ) }
37
64
</ Stack >
38
65
</ Stack >
39
66
) ;
40
67
} ;
41
-
42
- const useStyles = makeStyles ( ( theme ) => ( {
43
- root : {
44
- minHeight : theme . spacing ( 5 ) , // Make it predictable for the skeleton
45
- width : "100%" ,
46
- lineHeight : "150%" ,
47
- } ,
48
-
49
- info : {
50
- width : "100%" ,
51
- } ,
52
-
53
- title : {
54
- color : theme . palette . text . primary ,
55
- fontWeight : 600 ,
56
- } ,
57
-
58
- subtitle : {
59
- fontSize : 12 ,
60
- color : theme . palette . text . secondary ,
61
- lineHeight : "150%" ,
62
- maxWidth : 540 ,
63
- } ,
64
- } ) ) ;
0 commit comments