Skip to content

Commit 7c48103

Browse files
authored
fix: extra button behaviour in navbar (#566)
1 parent 80dff04 commit 7c48103

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/components/Navbar/MainMenu/MainMenu.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export const MainMenu = (props: MainMenuProps) => {
7575
mainUrl={extraButton.link}
7676
textColor={extraButton.textColor}
7777
backgroundColor={extraButton.backgroundColor}
78+
isExtraButton
7879
/>
7980
) : null}
8081
</div>

src/components/Navbar/MenuItem/MenuItem.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ export const MenuItem = (props: MenuItemProps) => {
1616
isMobile,
1717
mainUrl,
1818
textColor,
19-
backgroundColor
19+
backgroundColor,
20+
isExtraButton
2021
} = props
2122

2223
const mainRedirect = useCallback(() => {
@@ -27,7 +28,9 @@ export const MenuItem = (props: MenuItemProps) => {
2728
<Menu.Item
2829
active={activePage === section}
2930
onClick={(e: React.MouseEvent) => {
30-
isMobile ? onToggleShowSubMenu(e, true, section) : mainRedirect()
31+
isMobile && !isExtraButton
32+
? onToggleShowSubMenu(e, true, section)
33+
: mainRedirect()
3134
}}
3235
onMouseEnter={(e: React.MouseEvent) =>
3336
!isMobile && onToggleShowSubMenu(e, true, section)

src/components/Navbar/MenuItem/MenuItem.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export type MenuItemProps = {
1111
) => void
1212
mainUrl?: string
1313
isMobile?: boolean
14+
isExtraButton?: boolean
1415
textColor?: string
1516
backgroundColor?: string
1617
}

0 commit comments

Comments
 (0)