diff --git a/client/components/Nav.jsx b/client/components/Nav.jsx
index 31b7e5b8..4fc0ea61 100644
--- a/client/components/Nav.jsx
+++ b/client/components/Nav.jsx
@@ -217,6 +217,396 @@ class Nav extends React.PureComponent {
this.timer = setTimeout(this.setDropdown.bind(this, 'none'), 10);
}
+ renderProjectMenu(navDropdownState) {
+ return (
+
+ -
+
+
+ -
+
+
+ -
+
+
+ { __process.env.LOGIN_ENABLED && (!this.props.project.owner || this.isUserOwner()) &&
+ -
+
+
}
+ { this.props.project.id && this.props.user.authenticated &&
+ -
+
+
}
+ { this.props.project.id &&
+ -
+
+
}
+ { this.props.project.id &&
+ -
+
+
}
+ { this.props.user.authenticated &&
+ -
+
+ Open
+
+
}
+ { __process.env.EXAMPLES_ENABLED &&
+ -
+
+ Examples
+
+
}
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ {/* -
+
+
+ -
+
+
*/}
+
+
+ -
+
+
+ -
+
+
+ -
+ Reference
+
+
+ -
+
+ About
+
+
+ -
+
+ Feedback
+
+
+
+
+
+ );
+ }
+
+ renderUnauthenticatedUserMenu(navDropdownState) {
+ return (
+
+ -
+
+ Log in
+
+
+ or
+ -
+
+ Sign up
+
+
+
+ );
+ }
+
+ renderAuthenticatedUserMenu(navDropdownState) {
+ return (
+
+ -
+ Hello, {this.props.user.username}!
+
+ |
+ -
+
+
+ -
+
+ My sketches
+
+
+ -
+
+ My assets
+
+
+ -
+
+ Settings
+
+
+ -
+
+
+
+
+
+ );
+ }
+
+ renderUserMenu(navDropdownState) {
+ const isLoginEnabled = __process.env.LOGIN_ENABLED;
+ const isAuthenticated = this.props.user.authenticated;
+
+ if (isLoginEnabled && isAuthenticated) {
+ return this.renderAuthenticatedUserMenu(navDropdownState);
+ } else if (isLoginEnabled && !isAuthenticated) {
+ return this.renderUnauthenticatedUserMenu(navDropdownState);
+ }
+
+ return null;
+ }
+
render() {
const navDropdownState = {
file: classNames({
@@ -240,372 +630,11 @@ class Nav extends React.PureComponent {
'nav__item--open': this.state.dropdownOpen === 'account'
})
};
+
return (