Skip to content

Fix for issues#2519 #2624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ exports[`Default render 1`] = `
]
}
onChangeLevel1Id={[Function]}
openMore={true}
rightMenu={
<LoginNav
accountMenu={
Expand Down Expand Up @@ -131,6 +132,7 @@ exports[`Default render 1`] = `
loggedIn={true}
notificationButtonState="none"
notifications={Array []}
onMenuOpen={[Function]}
onSwitch={[Function]}
profile={
Object {
Expand All @@ -149,6 +151,7 @@ exports[`Default render 1`] = `
}
/>
}
setOpenMore={[Function]}
theme="light"
/>
</div>
Expand Down
12 changes: 12 additions & 0 deletions src/shared/components/Header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,20 @@ try {

const Header = ({ profile }) => {
const [activeLevel1Id, setActiveLevel1Id] = useState();
const [openMore, setOpenMore] = useState(true);

const handleChangeLevel1Id = (menuId) => {
setActiveLevel1Id(menuId);
};

const handleCloseOpenMore = () => {
setOpenMore(false);
};

const handleChangeOpenMore = (changedOpenMore) => {
setOpenMore(changedOpenMore);
};

const handleSwitchMenu = () => {
setActiveLevel1Id(config.HEADER_MENU[0].id);
};
Expand All @@ -48,6 +57,7 @@ const Header = ({ profile }) => {
accountMenu={config.ACCOUNT_MENU}
switchText={config.ACCOUNT_MENU_SWITCH_TEXT}
onSwitch={handleSwitchMenu}
onMenuOpen={handleCloseOpenMore}
showNotification={false}
profile={normalizedProfile}
authURLs={config.HEADER_AUTH_URLS}
Expand All @@ -57,6 +67,8 @@ const Header = ({ profile }) => {
theme={config.HEADER_MENU_THEME}
currentLevel1Id={activeLevel1Id}
onChangeLevel1Id={handleChangeLevel1Id}
openMore={openMore}
setOpenMore={handleChangeOpenMore}
/>
</div>
);
Expand Down