@@ -3,36 +3,39 @@ import Link from "@material-ui/core/Link"
3
3
import { makeStyles } from "@material-ui/core/styles"
4
4
import { FC } from "react"
5
5
import { Link as RouterLink } from "react-router-dom"
6
- import { combineClasses } from "../../util/combineClasses"
7
6
import { firstLetter } from "../../util/firstLetter"
7
+ import {
8
+ TableCellData ,
9
+ TableCellDataPrimary ,
10
+ TableCellDataSecondary ,
11
+ } from "../TableCellData/TableCellData"
8
12
9
13
export interface AvatarDataProps {
10
14
title : string
11
15
subtitle : string
16
+ highlightTitle ?: boolean
12
17
link ?: string
13
18
}
14
19
15
- export const AvatarData : FC < AvatarDataProps > = ( { title, subtitle, link } ) => {
20
+ export const AvatarData : FC < AvatarDataProps > = ( { title, subtitle, link, highlightTitle } ) => {
16
21
const styles = useStyles ( )
17
22
18
23
return (
19
24
< div className = { styles . root } >
20
25
< Avatar className = { styles . avatar } > { firstLetter ( title ) } </ Avatar >
21
26
22
27
{ link ? (
23
- < Link
24
- component = { RouterLink }
25
- to = { link }
26
- className = { combineClasses ( [ styles . info , styles . link ] ) }
27
- >
28
- < b > { title } </ b >
29
- < span > { subtitle } </ span >
28
+ < Link to = { link } underline = "none" component = { RouterLink } >
29
+ < TableCellData >
30
+ < TableCellDataPrimary highlight = { highlightTitle } > { title } </ TableCellDataPrimary >
31
+ < TableCellDataSecondary > { subtitle } </ TableCellDataSecondary >
32
+ </ TableCellData >
30
33
</ Link >
31
34
) : (
32
- < div className = { styles . info } >
33
- < b > { title } </ b >
34
- < span > { subtitle } </ span >
35
- </ div >
35
+ < TableCellData >
36
+ < TableCellDataPrimary highlight = { highlightTitle } > { title } </ TableCellDataPrimary >
37
+ < TableCellDataSecondary > { subtitle } </ TableCellDataSecondary >
38
+ </ TableCellData >
36
39
) }
37
40
</ div >
38
41
)
@@ -46,20 +49,4 @@ const useStyles = makeStyles((theme) => ({
46
49
avatar : {
47
50
marginRight : theme . spacing ( 1.5 ) ,
48
51
} ,
49
- info : {
50
- display : "flex" ,
51
- flexDirection : "column" ,
52
- color : theme . palette . text . primary ,
53
-
54
- "& span" : {
55
- fontSize : 12 ,
56
- color : theme . palette . text . secondary ,
57
- } ,
58
- } ,
59
- link : {
60
- textDecoration : "none" ,
61
- "&:hover" : {
62
- textDecoration : "underline" ,
63
- } ,
64
- } ,
65
52
} ) )
0 commit comments