|
@@ -11,8 +11,19 @@ import ChangeLogin from './LoginFild';
|
|
|
import ChangePassword from './PasswordFields'
|
|
|
|
|
|
// redux-connected container
|
|
|
+const user = {
|
|
|
+ "data": {
|
|
|
+ "_id": "5c48461c40ca670017ba5974",
|
|
|
+ "name": "Debil",
|
|
|
+ "email": "superus@lol.com",
|
|
|
+ "password": "$2a$10$qoxrQ2Sp3BDTLa9Xdc0ZPuLVHamipMQRWxeWxw1RwthICnbPoFLvC",
|
|
|
+ "profilePhoto": "",
|
|
|
+ "role": 0
|
|
|
+ },
|
|
|
+ "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVjNDg0NjFjNDBjYTY3MDAxN2JhNTk3NCIsInJvbGUiOjAsImlhdCI6MTU0ODI1NTczMiwiZXhwIjoxNTQ4MzQyMTMyfQ.RAIiCLjBJ2u1VEQWy1oUgPjHj0dZRG27l0J3c8FDss0"
|
|
|
+}
|
|
|
|
|
|
-class profilePage extends React.Component {
|
|
|
+class ProfilePage extends React.Component {
|
|
|
|
|
|
state = {
|
|
|
files: null,
|
|
@@ -49,21 +60,26 @@ class profilePage extends React.Component {
|
|
|
|
|
|
|
|
|
render() {
|
|
|
- const { user:{data},users, userChangeRequest,passwordChangeRequest } = this.props;
|
|
|
-
|
|
|
- // console.log('User', users);
|
|
|
+ const { users, userChangeRequest,passwordChangeRequest } = this.props;
|
|
|
+ const {data} = user
|
|
|
+ console.log('User', data);
|
|
|
// console.log('Props', this.props);
|
|
|
// console.log('State', this.state);
|
|
|
|
|
|
return (
|
|
|
<div className="page page--bottom-only profile-page">
|
|
|
<section className="container section section--about">
|
|
|
+ <img src =" https://cdn.iconscout.com/icon/free/png-256/avatar-373-456325.png" ></img>
|
|
|
{/* <h2 className="section__element section__element--header">{data.login}</h2> */}
|
|
|
-
|
|
|
+ <section className="container section section--about">
|
|
|
+ <div className="sedtion__element section__element--login">
|
|
|
+ <h3>Name</h3>
|
|
|
+ <p>{data.name}</p>
|
|
|
+ </div>
|
|
|
<div className="sedtion__element section__element--login">
|
|
|
<h3>Email</h3>
|
|
|
{/* <p>{user.login}<button className="link link--btn right" >Change login</button></p> */}
|
|
|
- <ChangeLogin className="link link--btn right" data={data} actions={{ userChangeRequest }}>{data.login}</ChangeLogin>
|
|
|
+ <ChangeLogin className="link link--btn right" data={data} actions={{ userChangeRequest }}>{data.email}</ChangeLogin>
|
|
|
</div>
|
|
|
<div className="section__element section__element--">
|
|
|
<h3>Password</h3>
|
|
@@ -73,6 +89,7 @@ class profilePage extends React.Component {
|
|
|
<h3>Status</h3>
|
|
|
<p>{data.description}</p>
|
|
|
</div>
|
|
|
+ </section>
|
|
|
</section>
|
|
|
<section className="container section section--stats">
|
|
|
<div className="section__element section__element--">
|
|
@@ -108,5 +125,5 @@ const
|
|
|
|
|
|
const mapDispatchToProps = dispatch => bindActionCreators({ userChangeRequest, passwordChangeRequest }, dispatch);
|
|
|
|
|
|
-export default connect(mapStateToProps, mapDispatchToProps)(profilePage);
|
|
|
+export default connect(mapStateToProps, mapDispatchToProps)(ProfilePage);
|
|
|
|