Skip to content
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

MaryiaF/fix: bold the menu option when the user has gone by the child… #4965

Merged
merged 12 commits into from
Mar 16, 2022
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const SubMenu = ({
submenu_icon,
submenu_title,
submenu_suffix_icon,
route_config_path,
}) => {
const [is_expanded, setIsExpanded] = React.useState(false);

Expand All @@ -28,7 +29,11 @@ const SubMenu = ({
<div className={classNames('dc-mobile-drawer__submenu-toggle', submenu_toggle_class)} onClick={toggleMenu}>
{submenu_icon && <Icon className='dc-mobile-drawer__submenu-toggle-icon' icon={submenu_icon} />}
{submenu_title && (
<Text as='h3' size='xs'>
<Text
as='h3'
size='xs'
weight={window.location.pathname.startsWith(route_config_path) ? 'bold' : null}
>
{submenu_title}
</Text>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import classNames from 'classnames';
import React from 'react';
import { Div100vhContainer, Icon, MobileDrawer, ToggleSwitch } from '@deriv/components';
import { Div100vhContainer, Icon, MobileDrawer, ToggleSwitch, Text } from '@deriv/components';
import { routes, PlatformContext } from '@deriv/shared';
import { localize, getAllowedLanguages } from '@deriv/translations';
import { NetworkStatus } from 'App/Components/Layout/Footer';
Expand Down Expand Up @@ -64,7 +64,14 @@ const MenuLink = ({
onClick={onClickLink}
>
<Icon className='header__menu-mobile-link-icon' icon={icon} />
<span className='header__menu-mobile-link-text'>{text}</span>
<Text
className={text === localize('Trade') ? '' : 'header__menu-mobile-link-text'}
as='h3'
size='xs'
weight={window.location.pathname === '/' && text === localize('Trade') ? 'bold' : null}
>
{text}
</Text>
{suffix_icon && <Icon className='header__menu-mobile-link-suffix-icon' icon={suffix_icon} />}
</BinaryLink>
);
Expand Down Expand Up @@ -178,6 +185,7 @@ const ToggleMenuDrawer = React.forwardRef(
submenu_title={route_config.getTitle()}
submenu_suffix_icon='IcChevronRight'
onToggle={expandSubMenu}
route_config_path={route_config.path}
>
{!has_subroutes &&
route_config.routes.map((route, index) => {
Expand Down