diff --git a/src/components/panels/common_links.jsx b/src/components/panels/common_links.jsx index eb3b474..11f2e37 100644 --- a/src/components/panels/common_links.jsx +++ b/src/components/panels/common_links.jsx @@ -1,5 +1,6 @@ import React from 'react'; import { withRouter, Link } from 'react-router-dom'; +import { connect } from 'react-redux'; import Logout from './logout.jsx'; @@ -12,26 +13,57 @@ class CommonLinks extends React.Component { } render() { + //render extra stuff let Extra; - if (this.props.extra) { Extra = this.props.extra; } else { Extra = () => null; } + //disable the profile link when logged out + let ProfileLink; + if (this.props.loggedIn) { + ProfileLink = () =>
Go to your profile
; + } else { + ProfileLink = () => null; + } + + //disable the logout button when logged out + let LogoutLink; + if (this.props.loggedIn) { + LogoutLink = () =>Return home
-Go to your profile
+Go to the game ladder