|
@@ -1,17 +1,26 @@
|
|
|
import React from 'react';
|
|
|
import { connect } from "react-redux";
|
|
|
|
|
|
+import { getUserInfo } from "../../actions/getUserInfo";
|
|
|
+
|
|
|
import './profile.scss';
|
|
|
|
|
|
import manAvatar from '../../assets/img/man.svg';
|
|
|
import womanAvatar from '../../assets/img/woman.svg';
|
|
|
|
|
|
import Sidebar from '../../components/sidebar/Sidebar';
|
|
|
+//import SettingsForm from '../../components/settings-form/settingsForm';
|
|
|
|
|
|
export class Profile extends React.Component {
|
|
|
+ componentDidMount() {
|
|
|
+ this.props.getUserInfo(JSON.parse(localStorage.user).user._id)
|
|
|
+ }
|
|
|
+
|
|
|
render() {
|
|
|
- console.log('profileUser',JSON.parse(localStorage.user).user);
|
|
|
- const user = JSON.parse(localStorage.user).user;
|
|
|
+ //console.log('profileUser',JSON.parse(localStorage.user).user._id);
|
|
|
+ //const user = JSON.parse(localStorage.user).user;
|
|
|
+ const { user } = this.props;
|
|
|
+ console.log('user',user);
|
|
|
|
|
|
return (
|
|
|
<>
|
|
@@ -52,28 +61,46 @@ export class Profile extends React.Component {
|
|
|
<div className="profile-tabs-wrap">
|
|
|
<div className="tabs-main">
|
|
|
<input id="tab1" type="radio" name="tabs" checked readOnly hidden/>
|
|
|
- <label htmlFor="tab1">History</label>
|
|
|
+ <label htmlFor="tab1" className="tab-label">History</label>
|
|
|
|
|
|
- <input id="tab2" type="radio" name="tabs" readOnly hidden/>
|
|
|
- <label htmlFor="tab2">Settings</label>
|
|
|
+ {/*<input id="tab2" type="radio" name="tabs" readOnly hidden/>
|
|
|
+ <label htmlFor="tab2" className="tab-label">Settings</label>*/}
|
|
|
|
|
|
<div className="tab-item" id="content1">
|
|
|
- <p>
|
|
|
- Jerky jowl pork chop tongue, kielbasa shank venison. Capicola shank pig ribeye leberkas filet mignon brisket beef kevin tenderloin porchetta. Capicola fatback venison shank kielbasa, drumstick ribeye landjaeger beef kevin tail meatball pastrami prosciutto pancetta. Tail kevin spare ribs ground round ham ham hock brisket shoulder. Corned beef tri-tip leberkas flank sausage ham hock filet mignon beef ribs pancetta turkey.
|
|
|
- </p>
|
|
|
- <p>
|
|
|
- Bacon ipsum dolor sit amet landjaeger sausage brisket, jerky drumstick fatback boudin.
|
|
|
- </p>
|
|
|
+ <div className="history">
|
|
|
+ {/* название ивента, дистанция, время, место */}
|
|
|
+ <table>
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>Event</th>
|
|
|
+ <th>Distance</th>
|
|
|
+ <th>Time</th>
|
|
|
+ <th>Rating</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ <tr>
|
|
|
+ <td>ULTRA MARATHON OF THE ATLANTIC 2019</td>
|
|
|
+ <td>marathone</td>
|
|
|
+ <td>3h40</td>
|
|
|
+ <td>39</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>CORFU HALF MARATHON</td>
|
|
|
+ <td>Half marathone</td>
|
|
|
+ <td>2h30</td>
|
|
|
+ <td>30</td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
- <div className="tab-item" id="content2">
|
|
|
- <p>
|
|
|
- Bacon ipsum dolor sit amet landjaeger sausage brisket, jerky drumstick fatback boudin.
|
|
|
- </p>
|
|
|
- <p>
|
|
|
- Jerky jowl pork chop tongue, kielbasa shank venison. Capicola shank pig ribeye leberkas filet mignon brisket beef kevin tenderloin porchetta. Capicola fatback venison shank kielbasa, drumstick ribeye landjaeger beef kevin tail meatball pastrami prosciutto pancetta. Tail kevin spare ribs ground round ham ham hock brisket shoulder. Corned beef tri-tip leberkas flank sausage ham hock filet mignon beef ribs pancetta turkey.
|
|
|
- </p>
|
|
|
- </div>
|
|
|
+ {/*<div className="tab-item" id="content2">
|
|
|
+ <div className="settings">
|
|
|
+ <SettingsForm initialValues={JSON.parse(localStorage.user).user}/>
|
|
|
+ </div>
|
|
|
+ </div>*/}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -84,10 +111,11 @@ export class Profile extends React.Component {
|
|
|
|
|
|
const mapStateToProps = state => {
|
|
|
return {
|
|
|
- user: state.login.user
|
|
|
+ user: state.userInfo.userProfile
|
|
|
};
|
|
|
};
|
|
|
|
|
|
export default connect(
|
|
|
- mapStateToProps
|
|
|
+ mapStateToProps,
|
|
|
+ { getUserInfo }
|
|
|
)(Profile);
|