File tree Expand file tree Collapse file tree 2 files changed +15
-20
lines changed
webapp/javascript/components Expand file tree Collapse file tree 2 files changed +15
-20
lines changed Original file line number Diff line number Diff line change 13
13
"no-restricted-globals": ["warn"],
14
14
"react/button-has-type": ["warn"],
15
15
"react/prop-types": ["warn"],
16
- "jsx-a11y/heading-has-content": ["warn"]
16
+ "jsx-a11y/heading-has-content": ["warn"],
17
+ "jsx-a11y/control-has-associated-label": ["warn"]
17
18
},
18
19
"env": {
19
20
"browser": true,
Original file line number Diff line number Diff line change 1
- import React from ' react' ;
1
+ import React from " react" ;
2
2
import { connect } from "react-redux" ;
3
3
import { removeLabel } from "../redux/actions" ;
4
4
5
- class Label extends React . Component {
6
- constructor ( props ) {
7
- super ( props ) ;
8
- }
5
+ function Label ( props ) {
6
+ const { label, removeLabel } = props ;
9
7
10
- removeLabel = ( ) => {
11
- this . props . removeLabel ( this . props . label . name ) ;
12
- } ;
13
-
14
- render ( ) {
15
- return < div className = "label" >
16
- < span className = "label-name" > { this . props . label . name } </ span >
17
- < span className = "label-value" > { this . props . label . value } </ span >
18
- < button className = "label-delete-btn" onClick = { this . removeLabel } > </ button >
8
+ return (
9
+ < div className = "label" >
10
+ < span className = "label-name" > { label . name } </ span >
11
+ < span className = "label-value" > { label . value } </ span >
12
+ < button
13
+ className = "label-delete-btn"
14
+ onClick = { ( ) => removeLabel ( label . name ) }
15
+ />
19
16
</ div >
20
- }
17
+ ) ;
21
18
}
22
19
23
- export default connect (
24
- ( x ) => x ,
25
- { removeLabel }
26
- ) ( Label ) ;
20
+ export default connect ( ( x ) => x , { removeLabel } ) ( Label ) ;
You can’t perform that action at this time.
0 commit comments