@@ -16,9 +16,9 @@ import LandingF from '../LandingF/LandingF'
16
16
17
17
class Home extends Component {
18
18
constructor ( props ) {
19
- super ( props ) ;
20
- this . handleCheckbox = this . handleCheckbox . bind ( this ) ;
21
- this . renderList = this . renderList . bind ( this ) ;
19
+ super ( props )
20
+ this . handleCheckbox = this . handleCheckbox . bind ( this )
21
+ this . renderList = this . renderList . bind ( this )
22
22
this . state = {
23
23
filters : {
24
24
causes : [ ] ,
@@ -36,7 +36,7 @@ class Home extends Component {
36
36
if ( this . props . projects !== nextProps . projects ) {
37
37
this . setState ( { filteredProjects : nextProps . projects } )
38
38
}
39
- } ;
39
+ }
40
40
41
41
projectContainsCause ( project ) {
42
42
return this . state . filters . causes . length === 0 || this . state . filters . causes . some ( cause => project . causes . indexOf ( cause ) >= 0 )
@@ -46,17 +46,17 @@ class Home extends Component {
46
46
}
47
47
48
48
handleCheckbox ( event , checked ) {
49
- const filters = this . state . filters ;
50
- const index = this . state . filters [ event . target . name ] . indexOf ( event . target . value ) ;
49
+ const filters = this . state . filters
50
+ const index = this . state . filters [ event . target . name ] . indexOf ( event . target . value )
51
51
if ( index === - 1 ) {
52
52
filters [ event . target . name ] . push ( event . target . value )
53
53
} else {
54
54
filters [ event . target . name ] . splice ( index , 1 )
55
55
}
56
- this . setState ( { filters } ) ;
56
+ this . setState ( { filters } )
57
57
const filteredProjects = this . props . projects . filter ( project => {
58
58
return this . projectContainsCause ( project ) && this . projectContainsTech ( project )
59
- } ) ;
59
+ } )
60
60
this . setState ( { filteredProjects } )
61
61
}
62
62
@@ -99,12 +99,12 @@ function mapStateToProps (state) {
99
99
const mapDispatchToProps = {
100
100
onLoad : ProjectActionCreator . fetchAllProjects
101
101
102
- } ;
102
+ }
103
103
104
104
Home . propTypes = {
105
105
onLoad : PropTypes . func ,
106
106
projects : PropTypes . array
107
107
108
- } ;
108
+ }
109
109
110
110
export default connect ( mapStateToProps , mapDispatchToProps ) ( Home )
0 commit comments