|
@@ -1,29 +1,53 @@
|
|
|
import React from 'react';
|
|
|
import { connect } from 'react-redux';
|
|
|
import { Field, reduxForm } from 'redux-form';
|
|
|
+import { bindActionCreators } from 'redux'
|
|
|
|
|
|
import formInput from '../../..//common/formInput';
|
|
|
- submit=()=>{
|
|
|
-
|
|
|
- }
|
|
|
+import { usersGetRequest } from '../../../../actions/adminActions/getUsers/index'
|
|
|
+import FormGetUsers from './formGetUsers/index'
|
|
|
|
|
|
-class createDeleteUser extends React.Component {
|
|
|
|
|
|
+class createDeleteUser extends React.Component {
|
|
|
+ componentDidMount() {
|
|
|
+ const { usersGetRequest } = this.props;
|
|
|
+ usersGetRequest();
|
|
|
+ }
|
|
|
render() {
|
|
|
- const { handleSubmit } = this.props;
|
|
|
+ const { handleSubmit, users:{data} } = this.props;
|
|
|
+ console.log(data)
|
|
|
return (
|
|
|
- <form className="page">
|
|
|
- <Field name="login" type="email" placeholder="Enter new login" component={formInput} />
|
|
|
- <button >Search</button>
|
|
|
- </form >
|
|
|
+ <div className="page page--bottom-only profile-page">
|
|
|
+ <section className="container section section--about">
|
|
|
+ <FormGetUsers></FormGetUsers>
|
|
|
+ </section>
|
|
|
+ <section className="container section section--about">
|
|
|
+ {data&&data.map(str=>
|
|
|
+ <div className="container section section--about">
|
|
|
+ <ul >
|
|
|
+ <h5>LOGIN</h5>
|
|
|
+ {str.login}
|
|
|
+ </ul>
|
|
|
+ <ul >
|
|
|
+ <h5>PASSWORD</h5>
|
|
|
+ {str.password}
|
|
|
+ </ul>
|
|
|
+ </div>)}
|
|
|
+ </section>
|
|
|
+ </div>
|
|
|
)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const
|
|
|
+ mapStateToProps = state => ({
|
|
|
+ users: state.users
|
|
|
+ });
|
|
|
+
|
|
|
|
|
|
-const mapDispatchToProps = dispatch => bindActionCreators({ userGetRequest }, dispatch);
|
|
|
+const mapDispatchToProps = dispatch => bindActionCreators({ usersGetRequest }, dispatch);
|
|
|
|
|
|
|
|
|
-export default connect(mapDispatchToProps)(reduxForm({
|
|
|
- form: "createDeleteUser",
|
|
|
+export default connect(mapStateToProps, mapDispatchToProps)(reduxForm({
|
|
|
+ form: "createDeleteUser",
|
|
|
})(createDeleteUser))
|