Skip to content

Commit

Permalink
Merge branch 'master' into evgeniy-wall-376/likhith-wall-379/verifica…
Browse files Browse the repository at this point in the history
…tion_ux_improvement_with_example
  • Loading branch information
yauheni-deriv authored Apr 26, 2023
2 parents 1de0176 + e1080db commit 48142c3
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 19 deletions.
4 changes: 2 additions & 2 deletions packages/appstore/src/components/main-title-bar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const MainTitleBar = () => {
<div className='main-title-bar'>
<div className='main-title-bar__right'>
<Text size='m' weight='bold'>
{localize("Trader's hub")}
{localize("Trader's Hub")}
</Text>
<AccountTypeDropdown />
</div>
Expand All @@ -35,7 +35,7 @@ const MainTitleBar = () => {
</DesktopWrapper>
<MobileWrapper>
<Text weight='bold' className='main-title-bar__text'>
{localize("Trader's hub")}
{localize("Trader's Hub")}
</Text>
<div className='main-title-bar-mobile'>
<div className='main-title-bar-mobile--account-type-dropdown'>
Expand Down
4 changes: 2 additions & 2 deletions packages/appstore/src/constants/tour-steps-config-new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const getTourStepConfig = (): Step[] => [
title: (
<React.Fragment>
<Text as='p' weight='bold' color='brand-red-coral'>
{localize("Trader's hub tour")}
{localize("Trader's Hub tour")}
</Text>
<div className='toggle-account-type__divider' />
</React.Fragment>
Expand Down Expand Up @@ -81,7 +81,7 @@ export const getTourStepConfigHighRisk = (): Step[] => [
title: (
<React.Fragment>
<Text as='p' weight='bold' color='brand-red-coral'>
{localize("Trader's hub tour")}
{localize("Trader's Hub tour")}
<div className='toggle-account-type__divider' />
</Text>
</React.Fragment>
Expand Down
2 changes: 1 addition & 1 deletion packages/appstore/src/constants/trading-hub-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const getTradingHubContents = (): TTradingHubContents => ({
}}
/>
),
footer_header: localize("Welcome to Trader's hub"),
footer_header: localize("Welcome to Trader's Hub"),
footer_text: localize('This is your personal start page for Deriv'),
has_next_content: false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('<AccountTransferNoAccount />', () => {
renderAccountTransferNoAccountWithRouter();

expect(screen.getByText('Transferring funds will require you to create a second account.')).toBeInTheDocument();
expect(screen.getByText("Back to trader's hub")).toBeInTheDocument();
expect(screen.getByText("Back to Trader's Hub")).toBeInTheDocument();
});

it('should show "Transferring funds will require you to create a second account." message and "Back to traders hub" button when is_dxtrade_allowed=true', () => {
Expand All @@ -46,13 +46,13 @@ describe('<AccountTransferNoAccount />', () => {
renderAccountTransferNoAccountWithRouter();

expect(screen.getByText('Transferring funds will require you to create a second account.')).toBeInTheDocument();
expect(screen.getByText("Back to trader's hub")).toBeInTheDocument();
expect(screen.getByText("Back to Trader's Hub")).toBeInTheDocument();
});

it('should navigate to traders hub, when the "Back to traders hub" button was clicked', () => {
renderAccountTransferNoAccountWithRouter();

const back_to_traders_hub_btn = screen.getByText("Back to trader's hub");
const back_to_traders_hub_btn = screen.getByText("Back to Trader's Hub");
fireEvent.click(back_to_traders_hub_btn);

expect(history.location.pathname).toBe(routes.traders_hub);
Expand All @@ -63,7 +63,7 @@ describe('<AccountTransferNoAccount />', () => {

renderAccountTransferNoAccountWithRouter();

const back_to_traders_hub_btn = screen.getByText("Back to trader's hub");
const back_to_traders_hub_btn = screen.getByText("Back to Trader's Hub");
fireEvent.click(back_to_traders_hub_btn);

expect(history.location.pathname).toBe(routes.traders_hub);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const AccountTransferNoAccount = observer(() => {
history.push(routes.traders_hub);
}}
>
<Localize i18n_default_text="Back to trader's hub" />
<Localize i18n_default_text="Back to Trader's Hub" />
</Button>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const PlatformDropdown = ({ app_routing_history, closeDrawer, platform_config, s
}}
>
<Text size='xs' weight='bold' align='center' className='platform-dropdown__cta--link'>
<Localize i18n_default_text="Looking for CFDs? Go to Trader's hub" />
<Localize i18n_default_text="Looking for CFDs? Go to Trader's Hub" />
</Text>
</BinaryLink>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ const ToggleMenuDrawer = observer(({ platform_config }) => {
<MenuLink
link_to={routes.traders_hub}
icon={is_dark_mode ? 'IcAppstoreHomeDark' : 'IcAppstoreTradersHubHome'}
text={localize("Trader's hub")}
text={localize("Trader's Hub")}
onClickLink={toggleDrawer}
/>
</MobileDrawer.Item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import AccountList from './account-switcher-account-list.jsx';
import AccountWrapper from './account-switcher-account-wrapper.jsx';
import { getSortedAccountList, getSortedCFDList, isDemo } from './helpers';
import { BinaryLink } from 'App/Components/Routes';
import { useHasSetCurrency } from '@deriv/hooks';

const AccountSwitcher = ({
available_crypto_currencies,
Expand Down Expand Up @@ -168,9 +169,7 @@ const AccountSwitcher = ({
return [];
};

const hasSetCurrency = () => {
return account_list.filter(account => !account.is_virtual).some(account => account.title !== 'Real');
};
const hasSetCurrency = useHasSetCurrency();

const getTotalDemoAssets = () => {
const vrtc_balance = accounts[vrtc_loginid] ? accounts[vrtc_loginid].balance : 0;
Expand Down Expand Up @@ -429,7 +428,7 @@ const AccountSwitcher = ({
<div className='acc-switcher__traders-hub'>
<BinaryLink onClick={handleRedirect} className='acc-switcher__traders-hub--link'>
<Text size='xs' align='center' className='acc-switcher__traders-hub--text'>
<Localize i18n_default_text="Looking for CFD accounts? Go to Trader's hub" />
<Localize i18n_default_text="Looking for CFD accounts? Go to Trader's Hub" />
</Text>
</BinaryLink>
</div>
Expand Down Expand Up @@ -511,7 +510,7 @@ const AccountSwitcher = ({
className='acc-switcher__btn--traders_hub'
secondary
onClick={
has_any_real_account && !hasSetCurrency()
has_any_real_account && !hasSetCurrency
? setAccountCurrency
: () => openRealAccountSignup('manage')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const TradersHubHomeButton = ({ is_dark_mode }) => {
/>
</div>
<Text className='trading-hub-header__tradershub--text'>
<Localize i18n_default_text="Trader's hub" />
<Localize i18n_default_text="Trader's Hub" />
</Text>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const SetAccountCurrencyModal = ({
toggleModal();
// timeout is to ensure no jumpy animation when modals are overlapping enter/exit transitions
setTimeout(() => {
setCurrency();
setCurrency('set_currency');
}, 250);
}}
primary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@

@include mobile {
position: relative;
padding: 1rem 0 0 1.3rem;
text-align: center;
}
}

Expand Down

0 comments on commit 48142c3

Please sign in to comment.