SearchStaff.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import React, { Component } from 'react';
  2. import { connect} from 'react-redux';
  3. import * as actions from "../actions/searchStaffAction";
  4. import { bindActionCreators } from "redux";
  5. import SearchStaffsPage from "../components/SearchStaffsPage"
  6. import LeftMenu from '../container/LeftMenu'
  7. import Header from '../container/Header'
  8. class SearchStaff extends Component {
  9. componentDidMount(){
  10. const { searchStaff, match } = this.props
  11. searchStaff(match.params.title)
  12. }
  13. render() {
  14. console.log(this.props)
  15. return (
  16. <div>
  17. <Header />
  18. <LeftMenu />
  19. <SearchStaffsPage {...this.props} />
  20. </div>
  21. );
  22. }
  23. }
  24. const mapStateToProps = state => ({
  25. searchData: state.searchStaff.searchData,
  26. isFetching: state.searchStaff.isFetching,
  27. });
  28. const mapDispatchToProps = dispatch => bindActionCreators({ ...actions }, dispatch);
  29. export default SearchStaff = connect(
  30. mapStateToProps,
  31. mapDispatchToProps
  32. )(SearchStaff);