Skip to content

Commit

Permalink
fix: scroll on navbar2 (#488)
Browse files Browse the repository at this point in the history
* fix: scroll on navbar2

* fix: user menu

* style: prettier
  • Loading branch information
braianj authored Jan 9, 2024
1 parent eae6457 commit b53b593
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/Navbar2/MainMenu/MainMenu.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
}

.dui-navbar2__menu.dui-navbar2__menu-mobile {
position: fixed;
position: absolute;
display: none;
flex-direction: column;
align-items: flex-start;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar2/Navbar2.css
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
.dui-navbar2 .item.submenu {
background-size: 100% 100%;
background-position: 0px 0px, 0px 0px;
position: fixed;
position: absolute;
top: -1000px;
z-index: 0;
left: 0;
Expand Down
1 change: 1 addition & 0 deletions src/components/UserMenu/UserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export const UserMenu = React.memo((props: UserMenuProps) => {
isOpen={isOpen}
i18n={i18n}
onClickToggle={handleToggle}
onClickClose={handleClose}
onClickUserMenuItem={onClickUserMenuItem}
onClickBalance={handleClickBalance}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const UserMenuSignedIn = (props: UserMenuSignedInProps) => {
onClickAccountSettings,
onClickActivity,
onClickBalance,
onClickClose,
onClickUserMenuItem,
onClickMyAssets,
onClickProfile,
Expand Down Expand Up @@ -170,6 +171,10 @@ export const UserMenuSignedIn = (props: UserMenuSignedInProps) => {
[onClickToggle]
)

const handleClickClose = useCallback(() => {
onClickClose()
}, [onClickClose])

const userAddress = useMemo(
() => avatar?.ethAddress || address,
[avatar, address]
Expand All @@ -190,7 +195,8 @@ export const UserMenuSignedIn = (props: UserMenuSignedInProps) => {
</div>
<div
className={classNames('menu-wrapper', isOpen && 'open')}
onMouseLeave={handleClickToggle}
onMouseLeave={handleClickClose}
onScroll={handleClickClose}
>
<div
className={classNames(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export type UserMenuSignedInProps = ManaBalancesProps & {
event: React.MouseEvent<HTMLElement, MouseEvent>
) => void
onClickActivity?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void
onClickClose?: () => void
onClickMyAssets?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void
onClickProfile?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void
onClickSignOut?: (
Expand Down

1 comment on commit b53b593

@vercel
Copy link

@vercel vercel bot commented on b53b593 Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

decentraland-ui – ./

decentraland-ui-decentraland1.vercel.app
decentraland-ui-git-master-decentraland1.vercel.app

Please sign in to comment.