Skip to content

Commit

Permalink
fix: logistration hide user menu icon on mobile screens (#111)
Browse files Browse the repository at this point in the history
VAN-227
  • Loading branch information
waheedahmed authored Dec 22, 2020
1 parent d8a0172 commit 7e59c25
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function Header({ intl }) {
username: authenticatedUser !== null ? authenticatedUser.username : null,
avatar: authenticatedUser !== null ? authenticatedUser.avatar : null,
mainMenu: getConfig().MINIMAL_HEADER || getConfig().LOGISTRATION_MINIMAL_HEADER ? [] : mainMenu,
userMenu,
userMenu: getConfig().LOGISTRATION_MINIMAL_HEADER ? [] : userMenu,
loggedOutItems: getConfig().LOGISTRATION_MINIMAL_HEADER ? [] : loggedOutItems,
};

Expand Down
30 changes: 17 additions & 13 deletions src/MobileHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ class MobileHeader extends React.Component {
stickyOnMobile,
intl,
mainMenu,
userMenu,
loggedOutItems,
} = this.props;
const logoProps = { src: logo, alt: logoAltText, href: logoDestination };
const stickyClassName = stickyOnMobile ? 'sticky-top' : '';
Expand Down Expand Up @@ -125,19 +127,21 @@ class MobileHeader extends React.Component {
{ logoDestination === null ? <Logo className="logo" src={logo} alt={logoAltText} /> : <LinkedLogo className="logo" {...logoProps} itemType="http://schema.org/Organization" />}
</div>
<div className="w-100 d-flex justify-content-end align-items-center">
<Menu tag="nav" aria-label={intl.formatMessage(messages['header.label.secondary.nav'])} className="position-static">
<MenuTrigger
tag="button"
className="icon-button"
aria-label={intl.formatMessage(messages['header.label.account.menu'])}
title={intl.formatMessage(messages['header.label.account.menu'])}
>
<Avatar size="1.5rem" src={avatar} alt={username} />
</MenuTrigger>
<MenuContent tag="ul" className="nav flex-column pin-left pin-right border-top shadow py-2">
{loggedIn ? this.renderUserMenuItems() : this.renderLoggedOutItems()}
</MenuContent>
</Menu>
{userMenu.length > 0 || loggedOutItems.length > 0 ? (
<Menu tag="nav" aria-label={intl.formatMessage(messages['header.label.secondary.nav'])} className="position-static">
<MenuTrigger
tag="button"
className="icon-button"
aria-label={intl.formatMessage(messages['header.label.account.menu'])}
title={intl.formatMessage(messages['header.label.account.menu'])}
>
<Avatar size="1.5rem" src={avatar} alt={username} />
</MenuTrigger>
<MenuContent tag="ul" className="nav flex-column pin-left pin-right border-top shadow py-2">
{loggedIn ? this.renderUserMenuItems() : this.renderLoggedOutItems()}
</MenuContent>
</Menu>
) : null}
</div>
</header>
);
Expand Down
1 change: 1 addition & 0 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ $white: #fff;
}

.site-header-mobile {
height: 3rem;
.nav-link {
text-decoration: none;
cursor: pointer;
Expand Down

0 comments on commit 7e59c25

Please sign in to comment.