Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the user profile dropdown menu #220

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/assets/scss/components/dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
padding: 4px 4px;
position: absolute;
top: 100%;
width: 114px;

&-left {
border-radius: 10px 0px 10px 10px;
Expand All @@ -50,7 +49,6 @@
background-color: $dropdown-colored-bg;
display: block;
margin-top: 8px;
width: 200px;
z-index: 100;
}

Expand All @@ -66,10 +64,12 @@
}

.dropdown-element {
padding: 4px 16px;

display:flex;
align-items: center;
padding:6px 18px;

.eos-icons {
padding: 0 8px 0 0;
padding:0px 8px 0 0;
}

&:hover {
Expand All @@ -78,6 +78,7 @@
}
}


.user-dropdown {
cursor: initial;
padding: 0px 16px;
Expand Down
18 changes: 12 additions & 6 deletions src/components/Navigation.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React, { useState, useEffect, useRef, useContext } from 'react'
import { Link, navigate } from '@reach/router'
import {
EOS_ACCOUNT_CIRCLE,
// EOS_ACCOUNT_CIRCLE,
// EOS_SETTING,
EOS_MESSAGE,
EOS_SETTINGS,
EOS_PERSON_OUTLINED,
EOS_EXIT_TO_APP
} from 'eos-icons-react'
import toast from 'react-hot-toast'
Expand Down Expand Up @@ -79,11 +80,14 @@ const Navigation = (props) => {
}}
ref={userDropdownContainer}
>
<EOS_ACCOUNT_CIRCLE
<img
src={`https://avatars.dicebear.com/api/jdenticon/${userName}.svg`}
className={`eos-icons ${
userDropdownState ? 'eos-icons-open' : ''
}`}
alt='Default User Avatar'
/>

<div
className={`dropdown nav-dropdown ${
userDropdownState
Expand All @@ -92,7 +96,9 @@ const Navigation = (props) => {
}`}
>
<ul className='dropdown-list nav-dropdown-list'>
<li className='user-dropdown user-dropdown-name'>{userName}</li>
<li className='user-dropdown user-dropdown-name'>
<center>{userName}</center>
</li>
<li className='user-dropdown user-dropdown-email'>
{userEmail}
</li>
Expand All @@ -110,8 +116,8 @@ const Navigation = (props) => {
data-cy='user-profile-btn'
onClick={() => navigate('/myProfile')}
>
<EOS_SETTINGS className='eos-icons eos-18' />
My Account
<EOS_PERSON_OUTLINED className='eos-icons eos-18' />
My Profile
</li>
<hr className='dropdown-separator' />
<li className='dropdown-element' onClick={handleLogout}>
Expand Down