Skip to content

Commit 9bee480

Browse files
committed
Lint & Modernize ZoomOutButton.jsx
1 parent 925f8a0 commit 9bee480

File tree

1 file changed

+13
-20
lines changed

1 file changed

+13
-20
lines changed
Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,26 @@
1-
import React from 'react';
1+
import React from "react";
22
import { connect } from "react-redux";
3-
import { setDateRange } from "../redux/actions";
43

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";
77

8-
class ZoomOutButton extends React.Component {
9-
constructor(props) {
10-
super(props);
11-
}
8+
function ZoomOutButton(props) {
9+
const { from, until, setDateRange } = props;
1210

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);
1713
};
1814

19-
render() {
20-
return <div>
21-
<button className="btn" onClick={this.zoomOut}>
15+
return (
16+
<div>
17+
<button className="btn" onClick={zoomOut}>
2218
&nbsp;
2319
<FontAwesomeIcon icon={faSearchMinus} />
2420
&nbsp;
2521
</button>
2622
</div>
27-
}
23+
);
2824
}
2925

30-
export default connect(
31-
(x) => x,
32-
{ setDateRange }
33-
)(ZoomOutButton);
26+
export default connect((x) => x, { setDateRange })(ZoomOutButton);

0 commit comments

Comments
 (0)