This repository was archived by the owner on Mar 4, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +34
-8
lines changed Expand file tree Collapse file tree 2 files changed +34
-8
lines changed Original file line number Diff line number Diff line change @@ -30,18 +30,23 @@ export const CheckItem = ({
30
30
< LinkBlock
31
31
block = { block }
32
32
/>
33
- < LinkStatus status = { block . status } > </ LinkStatus >
33
+ < LinkStatus status = { block . status } / >
34
34
</ LinkTextWrapper >
35
- < div
35
+ < LinkButton
36
+ aria-label = {
37
+ isExpanded ? 'Collapse' : 'Expand'
38
+ }
36
39
onClick = { ( ) => setIsExpanded ( ! isExpanded ) } > {
37
- isExpandable ? < ExpandIcon state = { isExpanded } /> : null } </ div >
40
+ isExpandable ? < ExpandIcon state = { isExpanded } /> : null } </ LinkButton >
38
41
</ LinkWrapper >
39
42
{ isExpandable && (
40
43
< Content data-stylizable = "block checkitem-content"
41
44
className = {
42
45
isExpanded ? 'expanded' : ''
43
46
} >
44
- < GenerateBlocks blocks = { supportedBlocks } />
47
+ { isExpanded && (
48
+ < GenerateBlocks blocks = { supportedBlocks } />
49
+ ) }
45
50
</ Content >
46
51
) }
47
52
</ Wrapper >
@@ -58,7 +63,11 @@ const ExpandIcon = ({
58
63
transform : state ? 'rotate(180deg)' : 'rotate(0deg)' ,
59
64
} }
60
65
>
61
- < DownIcon />
66
+ < DownIcon
67
+ title = {
68
+ state ? 'Collapse' : 'Expand'
69
+ }
70
+ />
62
71
</ ExpandIconWrapper >
63
72
)
64
73
}
@@ -98,6 +107,14 @@ const ExpandIconWrapper = styled.div`
98
107
cursor: pointer;
99
108
`
100
109
110
+ const LinkButton = styled . button `
111
+ background: none;
112
+ border: none;
113
+ cursor: pointer;
114
+ padding: 0;
115
+ margin: 0;
116
+ `
117
+
101
118
const Wrapper = styled . section `
102
119
margin-top: 0;
103
120
width: 100%;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
3
3
export const CheckIcon = ( {
4
- color = '#4CAF50'
4
+ color = '#4CAF50' ,
5
+ title = 'QA Passed'
5
6
} : {
6
7
color ?: string
8
+ title ?: string
7
9
} ) =>
8
10
( < svg width = "24" height = "24" viewBox = "0 0 24 24" fill = "none" xmlns = "http://www.w3.org/2000/svg" >
11
+ < title > { title } </ title >
9
12
< path d = "M5 12L10 17L20 7" stroke = { color } />
10
13
</ svg >
11
14
) ;
12
15
13
16
export const WarningIcon = ( {
14
- color = '#FF9800'
17
+ color = '#FF9800' ,
18
+ title = 'QA Not Passed'
15
19
} : {
16
20
color ?: string
21
+ title ?: string
17
22
} ) => (
18
23
< svg width = "24" height = "24" viewBox = "0 0 24 24" fill = "none" xmlns = "http://www.w3.org/2000/svg" >
24
+ < title > { title } </ title >
19
25
< path d = "M12 8V14 m0 2v1" stroke = { color } />
20
26
< path d = "M5 19H19C19.3263 18.9977 19.6471 18.9156 19.9344 18.7609C20.2217 18.6061 20.4667 18.3834 20.6482 18.1122C20.8297 17.841 20.942 17.5295 20.9754 17.2049C21.0089 16.8803 20.9624 16.5525 20.84 16.25L13.74 3.99999C13.567 3.68738 13.3135 3.42682 13.0058 3.24537C12.698 3.06393 12.3473 2.96823 11.99 2.96823C11.6327 2.96823 11.282 3.06393 10.9742 3.24537C10.6665 3.42682 10.413 3.68738 10.24 3.99999L3.14 16.25C3.01994 16.5456 2.97233 16.8656 3.00115 17.1833C3.02997 17.501 3.13437 17.8072 3.30565 18.0764C3.47693 18.3455 3.71011 18.5698 3.98573 18.7305C4.26134 18.8912 4.57139 18.9836 4.89 19" stroke = { color } />
21
27
</ svg >
22
28
)
23
29
24
30
export const DownIcon = ( {
25
- color = '#25408F'
31
+ color = '#25408F' ,
32
+ title = 'Open icon'
26
33
} : {
27
34
color ?: string
35
+ title ?: string
28
36
} ) => (
29
37
< svg width = "12" height = "7" viewBox = "0 0 12 7" fill = "none" xmlns = "http://www.w3.org/2000/svg" >
38
+ < title > { title } </ title >
30
39
< path d = "M1 1L6 6L11.5 1" stroke = { color } />
31
40
</ svg >
32
41
)
You can’t perform that action at this time.
0 commit comments