From 1810eb8f92aede5ea97f3a09363e9d423185c0c8 Mon Sep 17 00:00:00 2001 From: mattyl006 Date: Wed, 31 Aug 2022 13:48:09 +0200 Subject: [PATCH] dont show submit and myEntries when user is not logged --- src/components/elements/DesktopChallengeMenu.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/elements/DesktopChallengeMenu.js b/src/components/elements/DesktopChallengeMenu.js index 380f63a..0bcce84 100644 --- a/src/components/elements/DesktopChallengeMenu.js +++ b/src/components/elements/DesktopChallengeMenu.js @@ -3,6 +3,7 @@ import styled from 'styled-components'; import {FlexColumn} from '../../utils/containers'; import {H3} from '../../utils/fonts'; import PropsTypes from 'prop-types'; +import KeyCloakService from '../../services/KeyCloakService'; const DesktopChallengeMenuStyle = styled(FlexColumn)` justify-content: flex-start; @@ -35,7 +36,9 @@ const Option = styled(FlexColumn)` `; const DesktopChallengeMenu = (props) => { - const options = ['Leaderboard', 'Readme', 'How to', 'My entries', 'Submit']; + let options = ['Leaderboard', 'Readme', 'How to']; + if (KeyCloakService.isLoggedIn()) + options = ['Leaderboard', 'Readme', 'How to', 'My entries', 'Submit']; return ( {options.map((option, index) => {