File size: 991 Bytes
f5071ca |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
import React from 'react';
import {withRouter} from 'react-router-dom';
import CoverPicture from './cover_pic';
import ProfilePicture from './profile_pic';
import Header from '../navbar/header_container';
class ProfilePage extends React.Component{
constructor(props){
super(props);
}
componentDidMount(){
this.props.fetchUser(this.props.match.params.userId);
}
render(){
let {user}=this.props;
if (user === undefined){
return "";
}else{
return (
<div className="profile">
<Header class="main-header" user={this.props.user}/>
<section className="profile-sec">
<CoverPicture user={this.props.user}
currentUser={this.props.currentUser}
updateUser={this.props.updateUser}/>
<ProfilePicture user={this.props.user}
currentUser={this.props.currentUser}
updateUser={this.props.updateUser}/>
</section>
</div>
);}
}
}
export default withRouter(ProfilePage);
|