fix: 💄 Hide the menu on EventDetails
Simon Mulquin simon@octree.ch
Mon, 24 Jan 2022 14:34:23 +0100
1 files changed,
22 insertions(+),
17 deletions(-)
M
frontend/containers/EventBar/index.tsx
→
frontend/containers/EventBar/index.tsx
@@ -177,23 +177,28 @@ )}
</IconButton> </> )} - <GenericMenu - anchorEl={anchorEl} - setAnchorEl={setAnchorEl} - actions={[ - ...userInfos, - ...[ - { - label: detailsOpen - ? t('event.actions.hide_details') - : t('event.actions.show_details'), - onClick: toggleDetails, - id: 'DetailsTab', - }, - ], - ...menuActions, - ]} - /> + {!detailsOpen && ( + <GenericMenu + anchorEl={anchorEl} + setAnchorEl={setAnchorEl} + actions={[ + ...userInfos, + ...[ + { + label: detailsOpen + ? t('event.actions.hide_details') + : t('event.actions.show_details'), + onClick: e => { + setAnchorEl(null); + toggleDetails(); + }, + id: 'DetailsTab', + }, + ], + ...menuActions, + ]} + /> + )} </Toolbar> {detailsOpen && ( <EventDetails toggleDetails={toggleDetails} onShare={onShare} />