Header.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import React, { Component } from 'react';
  2. import HeaderLogo from '../components/Header/logo'
  3. import SearchLine from '../components/Header/searchLine'
  4. import Myprofile from '../components/Header/Myprofile'
  5. import 'antd/dist/antd.css';
  6. import { connect } from 'react-redux';
  7. import * as actions from "../actions/searchStaffAction";
  8. import { getUsersData } from '../actions/usersAuthActions'
  9. import { bindActionCreators } from "redux";
  10. class Header extends Component {
  11. render() {
  12. const { inputData, searchStaff, changeInputValue, name, getUser, id } = this.props
  13. return (
  14. <div className="header">
  15. <HeaderLogo />
  16. <SearchLine inputData={inputData}
  17. searchStaff={searchStaff}
  18. changeInputValue={changeInputValue}
  19. />
  20. <Myprofile name = {name} getUser={ getUser } id={ id } />
  21. </div>
  22. );
  23. }
  24. }
  25. const mapStateToProps = state => ({
  26. inputData: state.searchStaff.inputData,
  27. isFetching: state.searchStaff.isFetching,
  28. });
  29. const mapDispatchToProps = dispatch => bindActionCreators({ ...actions, getUsersData }, dispatch);
  30. export default Header = connect(
  31. mapStateToProps,
  32. mapDispatchToProps
  33. )(Header);