From 25a6a8060e44fc87790af83174ecfd03011bff36 Mon Sep 17 00:00:00 2001 From: mattyl006 Date: Wed, 31 Aug 2022 11:46:17 +0200 Subject: [PATCH] Mobile menu when login and LoggedBar items hover --- src/components/elements/LoggedBar.js | 18 ++++++++++++++++++ src/components/elements/MobileNavMenu.js | 21 +++++++++++++++------ src/components/elements/NavBar/NavBar.js | 9 ++++++++- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/src/components/elements/LoggedBar.js b/src/components/elements/LoggedBar.js index 2103ceb..b6c7987 100644 --- a/src/components/elements/LoggedBar.js +++ b/src/components/elements/LoggedBar.js @@ -22,6 +22,24 @@ const LoggedBarStyle = styled(FlexColumn)` button { cursor: pointer; + li { + transition: color 0.3s ease-in-out; + } + + div { + transition: background-color 0.3s ease-in-out; + } + + &:hover { + li { + color: ${({theme}) => theme.colors.green}; + } + + div { + background-color: ${({theme}) => theme.colors.green}; + } + } + * { cursor: pointer; } diff --git a/src/components/elements/MobileNavMenu.js b/src/components/elements/MobileNavMenu.js index 389761a..27ebb24 100644 --- a/src/components/elements/MobileNavMenu.js +++ b/src/components/elements/MobileNavMenu.js @@ -2,6 +2,7 @@ import React from 'react'; import {FlexColumn, FlexRow, Svg, TransBack} from '../../utils/containers'; import {Menu} from '../../utils/fonts'; import loginIco from '../../assets/login_ico.svg'; +import userIco from '../../assets/user_ico.svg'; import registerIco from '../../assets/register_ico.svg'; import cupIco from '../../assets/cup_ico.svg'; import styled from 'styled-components'; @@ -66,12 +67,20 @@ const MobileNavMenu = (props) => { : ''} {KeyCloakService.isLoggedIn() ? - - - - Sign out - - : + <> + + + + Profile + + + + + + Sign out + + + : diff --git a/src/components/elements/NavBar/NavBar.js b/src/components/elements/NavBar/NavBar.js index de7929d..1214f34 100644 --- a/src/components/elements/NavBar/NavBar.js +++ b/src/components/elements/NavBar/NavBar.js @@ -13,6 +13,8 @@ import {CHALLENGES_PAGE} from '../../../utils/globals'; import cupIco from '../../../assets/cup_ico.svg'; import NavBarStyle from './NavBarStyle'; import KeyCloakService from '../../../services/KeyCloakService'; +import Media from 'react-media'; +import theme from '../../../utils/theme'; const MenuButton = styled(Container)` width: 20px; @@ -43,7 +45,12 @@ const NavBar = (props) => { - + {KeyCloakService.isLoggedIn() ? + + + : + }