-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[dashboard] avatar menu #3491
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
[dashboard] avatar menu #3491
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
import { User } from "@gitpod/gitpod-protocol"; | ||
import { useContext } from "react"; | ||
import { Link } from "react-router-dom"; | ||
import { gitpodHostUrl } from "../service/service"; | ||
import { UserContext } from "../user-context"; | ||
import ContextMenu from "./ContextMenu"; | ||
|
||
interface Entry { | ||
title: string, link: string | ||
|
@@ -57,10 +60,27 @@ function Menu(props: { left: Entry[], right: Entry[] }) { | |
{props.right.map(MenuItem)} | ||
</ul> | ||
</nav> | ||
<Link className="lg:ml-3 flex items-center justify-start lg:mb-0 mb-4 pointer-cursor m-l-auto rounded-full border-2 border-white hover:border-gray-200 p-0.5" to="/account"> | ||
<img className="rounded-full w-6 h-6" | ||
src={user?.avatarUrl || ''} alt={user?.name || 'Anonymous'} /> | ||
</Link> | ||
<div className="lg:ml-3 flex items-center justify-start lg:mb-0 mb-4 pointer-cursor m-l-auto rounded-full border-2 border-white hover:border-gray-200 p-0.5"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: Could we make the border gray-500 when the profile menu is active (dropdown is visible)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems rather involving to do tbh There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True, let's drop this idea for now. |
||
<ContextMenu menuEntries={[ | ||
{ | ||
title: (user && User.getPrimaryEmail(user)) || '', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: This should be truncated, right? |
||
customFontStyle: 'text-gray-400', | ||
separator: true | ||
}, | ||
{ | ||
title: 'Settings', | ||
href: '/settings', | ||
separator: true | ||
}, | ||
{ | ||
title: 'Logout', | ||
href: gitpodHostUrl.asApiLogout().toString() | ||
}, | ||
]}> | ||
<img className="rounded-full w-6 h-6" | ||
src={user?.avatarUrl || ''} alt={user?.name || 'Anonymous'} /> | ||
</ContextMenu> | ||
</div> | ||
</div> | ||
</header> | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought: In the end, this dropdown should use the same spacing as the workspace more actions dropdown as described in #3496 (review).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went away from the inbetween spacing, because separators would be hard to align in the middle. They are no based on borders.