Fix GH-39: use the current user's profile URL

This commit is contained in:
Ray Schamp 2015-10-09 10:11:15 -06:00
parent a696f30040
commit f613255cc7

View file

@ -34,6 +34,10 @@ module.exports = React.createClass({
});
}
},
getProfileUrl: function () {
if (!this.state.session.user) return;
return '/users/' + this.state.session.user.username + '/';
},
handleLoginClick: function (e) {
e.preventDefault();
this.setState({'loginOpen': !this.state.loginOpen});
@ -122,7 +126,7 @@ module.exports = React.createClass({
as="ul"
isOpen={this.state.accountNavOpen}
onRequestClose={this.closeAccountNav}>
<li><a href="/users/raimondious/">Profile</a></li>
<li><a href={this.getProfileUrl()}>Profile</a></li>
<li><a href="/mystuff/">My Stuff</a></li>
<li><a href="/accounts/settings/">Account settings</a></li>
<li className="divider">