-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c85651d
commit 2616f5b
Showing
7 changed files
with
165 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,46 @@ | ||
import React from "react"; | ||
import { connect } from "react-redux"; | ||
|
||
import Layout from "./../components/Profile/Layout"; | ||
import Navbar from "./../components/Profile/Navbar"; | ||
import Back from "./../components/Profile/Back"; | ||
import EditInfo from "./../components/Profile/EditInfo"; | ||
import Layout from "../components/Profile/Layout"; | ||
import Navbar from "../components/Profile/Navbar"; | ||
import Back from "../components/Profile/Back"; | ||
import EditInfo from "../components/Profile/EditInfo"; | ||
import { logoutUser, fetchUserProfile } from "../redux/actions/authActions"; | ||
|
||
class EditProfile extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
isLoading: true, | ||
}; | ||
} | ||
|
||
componentDidMount() { | ||
const { fetchUserProfile } = this.props; | ||
fetchUserProfile(() => { | ||
this.setState({ isLoading: false }); | ||
}); | ||
} | ||
|
||
render() { | ||
const { logoutUser, user } = this.props; | ||
const { isLoading } = this.state; | ||
|
||
return ( | ||
<Layout> | ||
<Navbar /> | ||
<Navbar username={user.name} onLogout={logoutUser} /> | ||
<Back /> | ||
<EditInfo /> | ||
<EditInfo isLoading={isLoading} /> | ||
</Layout> | ||
); | ||
} | ||
} | ||
|
||
export default EditProfile; | ||
const mapStateToProps = (state) => ({ | ||
user: state.auth.user, | ||
}); | ||
|
||
export default connect(mapStateToProps, { | ||
logoutUser, | ||
fetchUserProfile, | ||
})(EditProfile); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.