File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed
src/design-system/flow-card Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,15 @@ interface Props {
14
14
icon ?: ReactNode ;
15
15
name : string ;
16
16
description ?: string ;
17
+ testId ?: string ;
17
18
}
18
19
19
20
export const Profile = ( {
20
21
imageSrc,
21
22
icon,
22
23
name,
23
24
description,
25
+ testId,
24
26
} : Readonly < Props > ) : JSX . Element => {
25
27
const renderProfileImage = ( ) => {
26
28
if ( typeof icon !== 'undefined' ) {
@@ -34,18 +36,33 @@ export const Profile = ({
34
36
< div className = { cx . container } >
35
37
< Grid columns = "$fitContent" gutters = "$0" >
36
38
< Cell >
37
- < Flex className = { cx . image } alignItems = "center" h = "$fill" >
39
+ < Flex
40
+ className = { cx . image }
41
+ alignItems = "center"
42
+ h = "$fill"
43
+ data-testid = { testId ? `${ testId } -image` : 'profile-image' }
44
+ >
38
45
{ renderProfileImage ( ) }
39
46
</ Flex >
40
47
</ Cell >
41
48
< Cell >
42
49
< Flex justifyContent = "center" flexDirection = "column" h = "$fill" >
43
- < Text . Body . Large color = "primary" weight = "$semibold" >
50
+ < Text . Body . Large
51
+ color = "primary"
52
+ weight = "$semibold"
53
+ data-testid = { testId ? `${ testId } -name` : 'profile-name' }
54
+ >
44
55
{ name }
45
56
</ Text . Body . Large >
46
57
{ description === undefined ? undefined : (
47
58
< Box >
48
- < Text . Body . Normal color = "secondary" weight = "$semibold" >
59
+ < Text . Body . Normal
60
+ color = "secondary"
61
+ weight = "$semibold"
62
+ data-testid = {
63
+ testId ? `${ testId } -description` : 'profile-description'
64
+ }
65
+ >
49
66
{ description }
50
67
</ Text . Body . Normal >
51
68
</ Box >
You can’t perform that action at this time.
0 commit comments