import React, { Component } from 'react';
import UserList from '../components/user_list';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { retrieveUsersAction } from '../actions/retrieve_users_action';

class UserSection extends Component {
  constructor() {
    super();
    this.state = {
      users: []
    };
  }

  componentDidMount() {
    this.props.retrieveUsersAction();
  }

  render() {
    return (
      <div>
        <UserList list={ this.props.users } />
      </div>
    );
  };
}

function mapStateToProps({ users }) {
  return { users };
}

function mapDispatchToProps(dispatch) {
  return bindActionCreators({ retrieveUsersAction }, dispatch);
}

export default connect(mapStateToProps, mapDispatchToProps)(UserSection);
@@ -503,16 +503,41 @@
 .users %7D
+ term=%7B this.props.term %7D
  /%3E%0A    
@@ -592,16 +592,22 @@
 (%7B users
+, term
  %7D) %7B%0A  
@@ -620,16 +620,22 @@
  %7B users
+, term
  %7D;%0A%7D%0A%0Af

add search term to user section