-
Notifications
You must be signed in to change notification settings - Fork 28
/
Github.js
29 lines (23 loc) · 947 Bytes
/
Github.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import React from 'react';
import IntroBox from '../../components/IntroBox/IntroBox.js';
import SearchBox from '../../components/SearchBox/SearchBox.js';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { changeUsername, findUsers } from '../../redux/modules/multipleUsers.js';// import action creators
const Github = ({ multipleUsers, changeUsername: propChangeUsername, findUsers: propFindUsers }) => {
return (
<div>
<IntroBox/>
<SearchBox changeUsername={propChangeUsername} findUsers={propFindUsers} {...multipleUsers} />
</div>
);
};
Github.propTypes = {
multipleUsers: React.PropTypes.object.isRequired,
changeUsername: React.PropTypes.func.isRequired,
findUsers: React.PropTypes.func.isRequired
};
export default connect(
(state) => ({multipleUsers: state.multipleUsers}),
(dispatch) => bindActionCreators({ changeUsername, findUsers }, dispatch)
)(Github);