Skip to content

Commit

Permalink
fix: close_button_on_responsive (binary-com#7465)
Browse files Browse the repository at this point in the history
  • Loading branch information
amina-deriv authored and Bahar committed Feb 2, 2023
1 parent 1673b66 commit 24bef10
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/account/src/Containers/account.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,15 @@ const PageOverlayWrapper = ({
subroutes,
history,
}) => {
const is_from_traders_hub = () => (is_pre_appstore ? history.push(shared_routes.traders_hub) : onClickClose());
const routeToPrevious = () => (is_pre_appstore ? history.push(shared_routes.traders_hub) : onClickClose());

if (isMobile() && selected_route) {
return (
<PageOverlay header={selected_route.getTitle()} onClickClose={onClickClose} is_from_app={is_from_derivgo}>
<PageOverlay
header={selected_route.getTitle()}
onClickClose={routeToPrevious}
is_from_app={is_from_derivgo}
>
<selected_route.component component_icon={selected_route.icon_component} />
</PageOverlay>
);
Expand All @@ -89,7 +93,7 @@ const PageOverlayWrapper = ({
}

return (
<PageOverlay header={localize('Settings')} onClickClose={is_from_traders_hub} is_from_app={is_from_derivgo}>
<PageOverlay header={localize('Settings')} onClickClose={routeToPrevious} is_from_app={is_from_derivgo}>
<VerticalTab
alignment='center'
is_floating
Expand Down

0 comments on commit 24bef10

Please sign in to comment.