all repos — caroster @ ac7c129ce3a5f103886fee0c738d5aab39af722a

[Octree] Group carpool to your event https://caroster.io

fix: 💄 Hide the menu on EventDetails
Simon Mulquin simon@octree.ch
Mon, 24 Jan 2022 14:34:23 +0100
commit

ac7c129ce3a5f103886fee0c738d5aab39af722a

parent

9e700046837e1356f38ebf38303313c053368149

1 files changed, 22 insertions(+), 17 deletions(-)

jump to
M frontend/containers/EventBar/index.tsxfrontend/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} />