diff --git a/ui/component/headerProfileMenuButton/view.jsx b/ui/component/headerProfileMenuButton/view.jsx index 1a3241edb..fab35826a 100644 --- a/ui/component/headerProfileMenuButton/view.jsx +++ b/ui/component/headerProfileMenuButton/view.jsx @@ -1,6 +1,9 @@ // @flow import 'scss/component/_header.scss'; +// $FlowFixMe +import { Global } from '@emotion/react'; + import { Menu as MuiMenu, MenuItem as MuiMenuItem } from '@mui/material'; import * as ICONS from 'constants/icons'; import * as PAGES from 'constants/pages'; @@ -26,93 +29,97 @@ export default function HeaderProfileMenuButton(props: HeaderMenuButtonProps) { const [anchorEl, setAnchorEl] = React.useState(null); const open = Boolean(anchorEl); - const handleClick = (event) => { - setAnchorEl(!anchorEl ? event.currentTarget : null); - }; - const handleClose = () => { - setAnchorEl(null); - }; + const handleClick = (event) => setAnchorEl(!anchorEl ? event.currentTarget : null); + const handleClose = () => setAnchorEl(null); const activeChannelUrl = activeChannelClaim && activeChannelClaim.permanent_url; // activeChannel will be: undefined = fetching, null = nothing, or { channel claim } const noActiveChannel = activeChannelUrl === null; const pendingChannelFetch = !noActiveChannel && myChannelClaimIds === undefined; - return ( -
- {pendingChannelFetch ? ( - - ) : ( - - )} - {authenticated ? ( - - - - - - - - + const menuProps = { + id: 'basic-menu', + anchorEl, + open, + onClose: handleClose, + MenuListProps: { + 'aria-labelledby': 'basic-button', + sx: { padding: 'var(--spacing-xs)' }, + }, + className: 'menu__list--header', + sx: { 'z-index': 2 }, + PaperProps: { className: 'MuiMenu-list--paper' }, + }; - -
-
- - {__('Sign Out')} -
- {email} -
-
-
- ) : ( - + {open && ( + - - - - - + /> )} -
+ +
+ {pendingChannelFetch ? ( + + ) : ( + + )} + {authenticated ? ( + + + + + + + + + + +
+
+ + {__('Sign Out')} +
+ {email} +
+
+
+ ) : ( + + + + + + + )} +
+ ); } diff --git a/ui/scss/component/menu-button.scss b/ui/scss/component/menu-button.scss index 4ce289a51..25da74847 100644 --- a/ui/scss/component/menu-button.scss +++ b/ui/scss/component/menu-button.scss @@ -31,6 +31,10 @@ reach-portal { max-width: calc(100% - var(--height-button) - var(--spacing-xs)); } +.MuiMenu-list--paper { + display: flex; +} + [data-reach-menu-list], .MuiMenu-list--paper { display: block;