Skip to content

Commit

Permalink
feat: Navbar adjustments (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
braianj authored Nov 22, 2024
1 parent 3098b78 commit 2fd4929
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/components/Navbar/MainMenu/MainMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const MainMenu = (props: MainMenuProps) => {
mainUrl={extraButton.link}
textColor={extraButton.textColor}
backgroundColor={extraButton.backgroundColor}
isExtraButton
/>
) : null}
</MainMenuContainer>
Expand Down
3 changes: 2 additions & 1 deletion src/components/Navbar/MenuItem/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const MenuItem = (props: MenuItemProps) => {
isMobile,
textColor,
backgroundColor,
isExtraButton,
} = props

const mainRedirect = useCallback(() => {
Expand All @@ -23,7 +24,7 @@ const MenuItem = (props: MenuItemProps) => {
<MenuItemContainer
active={activePage === section}
onClick={(e) => {
isMobile && onToggleShowSubMenu(e, true, section)
isMobile && !isExtraButton && onToggleShowSubMenu(e, true, section)
}}
onMouseEnter={(e) => !isMobile && onToggleShowSubMenu(e, true, section)}
onMouseLeave={(e) => !isMobile && onToggleShowSubMenu(e, false, section)}
Expand Down
1 change: 1 addition & 0 deletions src/components/Navbar/MenuItem/MenuItem.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type MenuItemProps = {
) => void
mainUrl?: string
isMobile?: boolean
isExtraButton?: boolean
textColor?: string
backgroundColor?: string
}
2 changes: 1 addition & 1 deletion src/components/Navbar/SubMenu/SubMenu.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const MenuItemContainer = styled(Box)((props: {
modifiedStyles = {
opacity: 1,
top: 0,
zIndex: 10,
zIndex: 1099,
boxShadow: theme.shadows[20],
}
mobileModifiedStyles = {
Expand Down
18 changes: 18 additions & 0 deletions src/components/Notifications/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,21 @@ type GovernanceTenderPassedNotificationProps = RawDecentralandNotification<
CommonGovernanceNotificationMetadataProps
>

type GovernanceVotedOnBehalfNotification = RawDecentralandNotification<
NotificationType.GOVERNANCE_VOTED_ON_BEHALF,
CommonGovernanceNotificationMetadataProps
>

type GovernanceWhaleVoteNotification = RawDecentralandNotification<
NotificationType.GOVERNANCE_WHALE_VOTE,
CommonGovernanceNotificationMetadataProps
>

type GovernanceCliffEndedNotification = RawDecentralandNotification<
NotificationType.GOVERNANCE_CLIFF_ENDED,
CommonGovernanceNotificationMetadataProps
>

type GovernanceNotificationsProps =
| GovernanceAnnouncementNotificationProps
| GovernanceProposalEnactedNotificationProps
Expand All @@ -145,6 +160,9 @@ type GovernanceNotificationsProps =
| GovernanceNewCommentOnProjectUpdateNotificationProps
| GovernancePitchPassedNotificationProps
| GovernanceTenderPassedNotificationProps
| GovernanceVotedOnBehalfNotification
| GovernanceWhaleVoteNotification
| GovernanceCliffEndedNotification

// Worlds Notifications

Expand Down
22 changes: 13 additions & 9 deletions src/components/UserMenu/UserMenuSignedIn/UserMenuSignedIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,19 @@ const UserMenuSignedIn = React.memo((props: UserMenuSignedInProps) => {
return (
<UserMenuSignedInContainer>
{notifications && <Notifications {...notifications} />}
<IconButton aria-label="activity" onClick={handleClickActivity}>
<Badge color="secondary" variant="dot" invisible={!hasActivity}>
<ActivityIcon />
</Badge>
</IconButton>
<ManaBalances
manaBalances={manaBalances}
onClickBalance={onClickBalance}
/>
{!isTabletAndBelow && (
<IconButton aria-label="activity" onClick={handleClickActivity}>
<Badge color="secondary" variant="dot" invisible={!hasActivity}>
<ActivityIcon />
</Badge>
</IconButton>
)}
{!isTabletAndBelow && (
<ManaBalances
manaBalances={manaBalances}
onClickBalance={onClickBalance}
/>
)}
<AvatarFaceContainer onClick={handleClickToggle}>
<AvatarFace size="medium" avatar={avatar} />
</AvatarFaceContainer>
Expand Down

0 comments on commit 2fd4929

Please sign in to comment.