Skip to content

Commit

Permalink
fix: roundup patch #3 based on code reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
shontzu-deriv committed May 8, 2023
1 parent 70e7db7 commit a543b67
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 17 deletions.
23 changes: 15 additions & 8 deletions packages/cfd/src/Containers/cfd-password-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -807,19 +807,26 @@ const CFDPasswordModal = ({
const mt5_platform_label = jurisdiction_selected_shortcode !== 'maltainvest' ? 'MT5' : '';

if (category === 'real') {
let platformName = '';
switch (platform) {
case CFD_PLATFORMS.MT5:
platformName = mt5_platform_label;
break;
case CFD_PLATFORMS.DERIVEZ:
platformName = 'Deriv Ez';
break;
default:
platformName = 'Deriv X';
break;
}

return (
<React.Fragment>
<Localize
i18n_default_text='Congratulations, you have successfully created your {{category}} <0>{{platform}}</0> <1>{{type}} {{jurisdiction_selected_shortcode}}</1> account. '
values={{
// TODO: remove below condition once deriv x changes are completed
type: platform === 'dxtrade' && type_label === 'Derived' ? 'Synthetic' : type_label,
platform:
platform === CFD_PLATFORMS.MT5
? mt5_platform_label
: platform === CFD_PLATFORMS.DERIVEZ
? 'Deriv Ez'
: 'Deriv X',
platform: platformName,
category: category_label,
jurisdiction_selected_shortcode:
platform === CFD_PLATFORMS.MT5 && !show_eu_related_content ? jurisdiction_label : '',
Expand All @@ -831,7 +838,7 @@ const CFDPasswordModal = ({
) : (
<ReviewMessageForMT5
is_selected_mt5_verified={is_selected_mt5_verified}
jurisdiction_selected_shortcode={jurisdiction_selected_shortcode}
jurisdiction_selected_shortcode={jurisdiction_label}
manual_status={manual_status}
/>
)}
Expand Down
6 changes: 3 additions & 3 deletions packages/cfd/src/Containers/trade-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { Text, Icon, Money } from '@deriv/components';
import { TTradingPlatformAccounts, TCFDDashboardContainer, TCFDsPlatformType } from 'Components/props.types';
import { DetailsOfEachMT5Loginid } from '@deriv/api-types';
import { CFD_PLATFORMS, getCFDAccountKey, isMobile, capitalizeFirstLetter } from '@deriv/shared';
import { CFD_PLATFORMS, getCFDAccountKey, isMobile } from '@deriv/shared';
import { localize, Localize } from '@deriv/translations';
import { getPlatformQRCode, PlatformsDesktopDownload } from '../Helpers/config';
import { getTitle, platformsText, mobileDownloadLink } from '../Helpers/constants';
Expand Down Expand Up @@ -54,13 +54,13 @@ const TradeModal = ({
platform,
}: TTradeModalProps) => {
const CTraderAndDerivEZDescription = () => {
const description = platform === 'derivez' ? 'Deriv EZ' : 'cTrader';
const platform_name = platform === 'derivez' ? 'Deriv EZ' : 'cTrader';
return (
<div className='cfd-trade-modal__login-specs-item'>
<Text className='cfd-trade-modal--paragraph'>
<Localize
i18n_default_text='Use your Deriv account email and password to login into the {{ platform }} platform.'
values={{ platform: description }}
values={{ platform: platform_name }}
/>
</Text>
</div>
Expand Down
4 changes: 2 additions & 2 deletions packages/cfd/src/Helpers/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { isMobile, OSDetect, isDesktopOs } from '@deriv/shared';
import { TCFDDashboardContainer } from 'Containers/props.types';

export const getPlatformQRCode = (acc_type: TCFDsPlatformType) => {
const qr_code_mobile = isMobile() ? '100%' : '80%';
const qr_code_width = isMobile() ? '100%' : '80%';
const os = OSDetect();
const checkForDesktop = isDesktopOs() ? (os === 'mac' ? 'ios' : 'android') : os;

Expand All @@ -17,7 +17,7 @@ export const getPlatformQRCode = (acc_type: TCFDsPlatformType) => {
<QRCode
value={mobileDownloadLink(acc_type, checkForDesktop)}
size={5}
style={{ height: 'auto', maxWidth: '100%', width: qr_code_mobile }}
style={{ height: 'auto', maxWidth: '100%', width: qr_code_width }}
/>
<Text align='center' size='xxs'>
<Localize
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/Stores/client-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,13 +631,13 @@ export default class ClientStore extends BaseStore {
if (!this.is_logged_in) return false;
let list;
switch (platform) {
case 'mt5':
case CFD_PLATFORMS.MT5:
list = this.mt5_login_list;
break;
case 'dxtrade':
case CFD_PLATFORMS.DXTRADE:
list = this.dxtrade_accounts_list;
break;
case 'derivez':
case CFD_PLATFORMS.DERIVEZ:
list = this.derivez_accounts_list;
break;
default:
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/Stores/traders-hub-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export default class TradersHubStore extends BaseStore {
is_account_type_modal_visible = false;
account_type_card = '';
selected_platform_type = 'options';
active_indx = 0;
open_failed_verification_for = '';
modal_data = {
active_modal: '',
Expand Down

0 comments on commit a543b67

Please sign in to comment.