From 0aa1660cd1c6c2cecb1c7080c1e863805f2021e4 Mon Sep 17 00:00:00 2001 From: Felix Hamme Date: Wed, 17 Apr 2019 09:59:51 +0200 Subject: [PATCH] Link private tournament list in navigation bar if the user is signed in --- js/components/Navigation.js | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/js/components/Navigation.js b/js/components/Navigation.js index b9d0775..a58a33f 100644 --- a/js/components/Navigation.js +++ b/js/components/Navigation.js @@ -40,11 +40,7 @@ export class TurniereNavigation extends React.Component { - + @@ -60,6 +56,18 @@ function Navlink(props) { ); } +class SmartNavLinks extends React.Component { + + render() { + return (); + } +} + function Betabadge() { return (BETA); } @@ -87,12 +95,15 @@ class InvisibleLoginLogoutButtons extends React.Component { } } -const mapStateToLoginLogoutButtonProperties = (state) => { +const mapStateToUserinfo = (state) => { const { isSignedIn, username } = state.userinfo; return { isSignedIn, username }; }; const LoginLogoutButtons = connect( - mapStateToLoginLogoutButtonProperties + mapStateToUserinfo )(InvisibleLoginLogoutButtons); +const NavLinks = connect( + mapStateToUserinfo +)(SmartNavLinks); \ No newline at end of file