Skip to content
This repository was archived by the owner on Mar 1, 2024. It is now read-only.

Commit c91bc43

Browse files
committed
feat(SiteHeader): add prop for click handling of mobile collapse menu
1 parent 7b62e83 commit c91bc43

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/Site/SiteHeader.react.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ export type Props = {|
2525
+notificationsTray?: NotificationTrayProps,
2626
+accountDropdown?: AccountDropdownProps,
2727
+navItems?: React.Node,
28+
/**
29+
* Handle toggling/collapsing of the mobile menu when the collapse icon is clicked
30+
*/
31+
+onMenuToggleClick?: () => void,
2832
|};
2933

3034
/**
@@ -39,6 +43,7 @@ const SiteHeader = ({
3943
notificationsTray: notificationsTrayFromProps,
4044
accountDropdown: accountDropdownFromProps,
4145
navItems,
46+
onMenuToggleClick,
4247
}: Props): React.Node => {
4348
const notificationsTray =
4449
notificationsTrayFromProps &&
@@ -62,8 +67,7 @@ const SiteHeader = ({
6267
</div>
6368
<a
6469
className="header-toggler d-lg-none ml-3 ml-lg-0"
65-
data-toggle="collapse"
66-
data-target="#headerMenuCollapse"
70+
onClick={onMenuToggleClick}
6771
>
6872
<span className="header-toggler-icon" />
6973
</a>

0 commit comments

Comments
 (0)