File tree Expand file tree Collapse file tree 1 file changed +13
-20
lines changed
webapp/javascript/components Expand file tree Collapse file tree 1 file changed +13
-20
lines changed 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
- import { setDateRange } from "../redux/actions" ;
4
3
5
- import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' ;
6
- import { faSearchMinus } from '@fortawesome/free-solid-svg-icons'
4
+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" ;
5
+ import { faSearchMinus } from "@fortawesome/free-solid-svg-icons" ;
6
+ import { setDateRange } from "../redux/actions" ;
7
7
8
- class ZoomOutButton extends React . Component {
9
- constructor ( props ) {
10
- super ( props ) ;
11
- }
8
+ function ZoomOutButton ( props ) {
9
+ const { from, until, setDateRange } = props ;
12
10
13
- zoomOut = ( ) => {
14
- let from = this . props . from ;
15
- let until = this . props . until ;
16
- this . props . setDateRange ( from , until ) ;
11
+ const zoomOut = ( ) => {
12
+ setDateRange ( from , until ) ;
17
13
} ;
18
14
19
- render ( ) {
20
- return < div >
21
- < button className = "btn" onClick = { this . zoomOut } >
15
+ return (
16
+ < div >
17
+ < button className = "btn" onClick = { zoomOut } >
22
18
23
19
< FontAwesomeIcon icon = { faSearchMinus } />
24
20
25
21
</ button >
26
22
</ div >
27
- }
23
+ ) ;
28
24
}
29
25
30
- export default connect (
31
- ( x ) => x ,
32
- { setDateRange }
33
- ) ( ZoomOutButton ) ;
26
+ export default connect ( ( x ) => x , { setDateRange } ) ( ZoomOutButton ) ;
You can’t perform that action at this time.
0 commit comments