Skip to content

Commit

Permalink
[WALL] aum / WALL-4260 / remove-platform-switcher-from-menu-drawer-fo…
Browse files Browse the repository at this point in the history
…r-all-wallets-routes (deriv-com#15444)

* fix: remove the platform switcher from mobile menu drawer for all the wallets routes

* fix: remove platform-switcher for compare-accounts route as well

* feat: remove the go to deriv.com item from mobile drawer for legacy and wallets TH

* fix: Remove `Go to Deriv.com` item from mobile menu drawer

* chore: empty commit

* fix: added the separator before the Whatsapp link back
  • Loading branch information
aum-deriv authored Jun 6, 2024
1 parent f874c59 commit 8dd7f0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ const ToggleMenuDrawer = observer(({ platform_config }) => {
const { is_p2p_enabled } = useIsP2PEnabled();

const { pathname: route } = useLocation();
const location = useLocation();

const is_trading_hub_category =
route === routes.traders_hub || route.startsWith(routes.cashier) || route.startsWith(routes.account);

const should_hide_platform_switcher = location.pathname === routes.traders_hub;
const is_traders_hub_route = route === routes.traders_hub;

const is_wallet_route = route.startsWith(routes.wallets) || route.startsWith(routes.wallets_compare_accounts);

const isMounted = useIsMounted();
const { data } = useRemoteConfig(isMounted());
Expand Down Expand Up @@ -313,7 +314,7 @@ const ToggleMenuDrawer = observer(({ platform_config }) => {
<Div100vhContainer height_offset='40px'>
<div className='header__menu-mobile-body-wrapper'>
<React.Fragment>
{!should_hide_platform_switcher && (
{!(is_traders_hub_route || is_wallet_route) && (
<MobileDrawer.SubHeader
className={classNames({
'dc-mobile-drawer__subheader--hidden': is_submenu_expanded,
Expand All @@ -333,7 +334,7 @@ const ToggleMenuDrawer = observer(({ platform_config }) => {
</MobileDrawer.SubHeader>
)}

<MobileDrawer.Body className={should_hide_platform_switcher ? 'no-padding' : ''}>
<MobileDrawer.Body className={is_traders_hub_route || is_wallet_route ? 'no-padding' : ''}>
<div className='header__menu-mobile-platform-switcher' id='mobile_platform_switcher' />
<MobileDrawer.Item>
<MenuLink
Expand Down Expand Up @@ -400,7 +401,7 @@ const ToggleMenuDrawer = observer(({ platform_config }) => {
onClickLink={toggleDrawer}
/>
</MobileDrawer.Item>
<MobileDrawer.Item>
<MobileDrawer.Item className='header__menu-mobile-theme--responsible-trading'>
<MenuLink
link_to={getStaticUrl('/responsible')}
icon='IcVerification'
Expand All @@ -418,14 +419,6 @@ const ToggleMenuDrawer = observer(({ platform_config }) => {
/>
</MobileDrawer.Item>
)}
<MobileDrawer.Item className='header__menu-mobile-theme--trader-hub'>
<MenuLink
link_to={getStaticUrl('/')}
icon='IcDerivOutline'
text={localize('Go to Deriv.com')}
onClickLink={toggleDrawer}
/>
</MobileDrawer.Item>
</React.Fragment>
)}
{liveChat.isReady && cs_chat_whatsapp && (
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/sass/app/_common/layout/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
border-bottom: 1px solid var(--general-section-2);
padding-right: 0;

&--trader-hub {
&--responsible-trading {
border-bottom: 1px solid var(--general-section-2);
}
}
Expand Down

0 comments on commit 8dd7f0c

Please sign in to comment.