Skip to content

Commit

Permalink
fix: roundup patch #1 based on reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
shontzu-deriv committed Apr 27, 2023
1 parent 750c147 commit 0de6365
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 51 deletions.
11 changes: 10 additions & 1 deletion packages/appstore/src/components/cfds-listing/cfds-listing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
background: var(--brand-dark-grey);
align-items: center;
text-decoration: none;
padding: 0.2rem;
padding: 0.4rem;
border-radius: $BORDER_RADIUS;

&-text {
Expand All @@ -237,6 +237,9 @@
white-space: nowrap;
}
}
&-icon {
padding-left: 0.6rem;
}
}
&__specs {
padding: 1.6rem;
Expand Down Expand Up @@ -292,6 +295,12 @@
padding-top: 2rem;
padding-bottom: 5.8rem;

&-description {
display: flex;
justify-content: center;
margin-top: 1.4rem;
}

&-app {
display: flex;
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const StaticDashboard = ({
loginid,
}: TStaticDashboard) => {
const { client, traders_hub } = useStores();
const { content_flag } = traders_hub;
const { content_flag, CFDs_restricted_countries } = traders_hub;
const { is_eu_country, is_logged_in } = client;

//starting ctrader project
Expand Down Expand Up @@ -436,7 +436,7 @@ const StaticDashboard = ({
</div>

<div className='static-dashboard-wrapper__body'>
{!is_eu_user && (
{!is_eu_user && !CFDs_restricted_countries && (
<StaticCFDAccountManager
type='synthetic'
platform='mt5'
Expand Down Expand Up @@ -473,7 +473,7 @@ const StaticDashboard = ({
is_eu_user={is_eu_user}
/>
)}
{!is_eu_user && (
{!is_eu_user && !CFDs_restricted_countries && (
<StaticCFDAccountManager
type='financial'
platform='mt5'
Expand Down Expand Up @@ -504,7 +504,7 @@ const StaticDashboard = ({
)}
</div>

{!is_eu_user && (
{!is_eu_user && !CFDs_restricted_countries && (
<React.Fragment>
<Divider />
<div className='static-dashboard-wrapper__body--header'>
Expand All @@ -523,7 +523,7 @@ const StaticDashboard = ({
</div>
</React.Fragment>
)}
{!is_eu_user && (
{!is_eu_user && !CFDs_restricted_countries && (
<div className='static-dashboard-wrapper__body'>
<StaticCFDAccountManager
type='all'
Expand Down
9 changes: 7 additions & 2 deletions packages/cfd/src/Containers/cfd-password-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ const IconType = React.memo(({ platform, type, show_eu_related_content }: TIconT
return <Icon icon='IcDxtradeDerivxPlatform' size={128} />;
}
} else if (platform === CFD_PLATFORMS.DERIVEZ) {
return <Icon icon='IcBrandDerivez' size={128} />;
return <Icon icon='IcBrandDerivEz' size={128} />;
} else if (traders_hub) {
switch (type) {
case 'synthetic':
Expand Down Expand Up @@ -833,7 +833,12 @@ const CFDPasswordModal = ({
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 : 'Deriv X',
platform:
platform === CFD_PLATFORMS.MT5
? mt5_platform_label
: platform === CFD_PLATFORMS.DERIVEZ
? 'Deriv Ez'
: 'Deriv X',
category: category_label,
jurisdiction_selected_shortcode:
platform === CFD_PLATFORMS.MT5 && !show_eu_related_content ? jurisdiction_label : '',
Expand Down
22 changes: 8 additions & 14 deletions packages/cfd/src/Containers/trade-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,31 +74,23 @@ const TradeModal = ({
</div>
);
};
const downloadCenterAppOption = (account_type: TCFDsPlatformType) => {
if (account_type === 'dxtrade') {
const downloadCenterAppOption = (platform_type: TCFDsPlatformType) => {
if (platform_type === 'dxtrade') {
return (
<div className='cfd-trade-modal__download-center-app--option'>
<Text className='cfd-trade-modal__download-center-app--option-item' size='xs'>
{localize('Run Deriv X on your browser')}
</Text>
<PlatformsDesktopDownload
platform={account_type}
is_demo={is_demo}
dxtrade_tokens={dxtrade_tokens}
/>
<PlatformsDesktopDownload platform={platform} is_demo={is_demo} dxtrade_tokens={dxtrade_tokens} />
</div>
);
} else if (account_type === 'derivez') {
} else if (platform_type === 'derivez') {
return (
<div className='cfd-trade-modal__download-center-app--option'>
<Text className='cfd-trade-modal__download-center-app--option-item' size='xs'>
{localize('Run Deriv EZ on your browser')}
</Text>
<PlatformsDesktopDownload
platform={account_type}
is_demo={is_demo}
dxtrade_tokens={dxtrade_tokens}
/>
<PlatformsDesktopDownload platform={platform} is_demo={is_demo} dxtrade_tokens={dxtrade_tokens} />
</div>
);
}
Expand Down Expand Up @@ -162,7 +154,9 @@ const TradeModal = ({
className='cfd-trade-modal__maintenance-icon'
/>
<div className='cfd-trade-modal__maintenance-text'>
<Localize i18n_default_text='Server maintenance starts at 06:00 GMT every Sunday and may last up to 2 hours. You may experience service disruption during this time.' />
<Text size='xxxs' className='cfd-trade-modal__maintenance-text'>
<Localize i18n_default_text='Server maintenance starts at 06:00 GMT every Sunday and may last up to 2 hours. You may experience service disruption during this time.' />
</Text>
</div>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion packages/cfd/src/Stores/Modules/CFD/cfd-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ export default class CFDStore extends BaseStore {
password: CFD_PLATFORMS.DXTRADE ? values.password : '',
platform: values.platform,
account_type: this.account_type.category,
// market_type: this.account_type.type === 'dxtrade' ? 'all' : this.account_type.type,
market_type:
this.account_type.type === 'dxtrade' || this.account_type.type === 'derivez'
? 'all'
Expand Down
10 changes: 8 additions & 2 deletions packages/cfd/src/sass/cfd-dashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
}
}

&-dxtrade-button {
&__dxtrade-button {
background: $color-black-7;
border-radius: $BORDER_RADIUS;
text-decoration: none;
Expand All @@ -255,7 +255,7 @@
padding: 0.4rem 0rem 0.4rem 0.2rem;
}
&-icon {
margin-left: 0.6rem;
padding-left: 0.6rem;
}
}

Expand Down Expand Up @@ -1254,6 +1254,12 @@
padding-top: 2rem;
padding-bottom: 5.8rem;

&-description {
display: flex;
justify-content: center;
margin-top: 1.4rem;
}

&-app {
display: flex;
flex-direction: column;
Expand Down

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion packages/components/src/components/icon/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import './brand/ic-brand-deriv-apps.svg';
import './brand/ic-brand-deriv-ez-wordmark.svg';
import './brand/ic-brand-deriv-ez.svg';
import './brand/ic-brand-deriv.svg';
import './brand/ic-brand-derivez.svg';
import './brand/ic-brand-derivgo.svg';
import './brand/ic-brand-dmt5-financial-stp.svg';
import './brand/ic-brand-dmt5-financial.svg';
Expand Down
1 change: 0 additions & 1 deletion packages/components/stories/icon/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export const icons =
'IcBrandDerivEzWordmark',
'IcBrandDerivEz',
'IcBrandDeriv',
'IcBrandDerivez',
'IcBrandDerivgo',
'IcBrandDmt5FinancialStp',
'IcBrandDmt5Financial',
Expand Down
27 changes: 16 additions & 11 deletions packages/core/src/Stores/client-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -624,15 +624,20 @@ export default class ClientStore extends BaseStore {

hasAccountErrorInCFDList = (platform, account_type) => {
if (!this.is_logged_in) return false;

const list =
platform === CFD_PLATFORMS.MT5
? this.mt5_login_list
: platform === CFD_PLATFORMS.DXTRADE
? this.dxtrade_accounts_list
: platform === CFD_PLATFORMS.DERIVEZ
? this.derivez_accounts_list
: '';
let list;
switch (platform) {
case 'mt5':
list = this.mt5_login_list;
break;
case 'dxtrade':
list = this.dxtrade_accounts_list;
break;
case 'derivez':
list = this.derivez_accounts_list;
break;
default:
return false;
}
return list?.some(account => !!account.has_error && account.account_type === account_type);
};

Expand Down Expand Up @@ -1287,6 +1292,7 @@ export default class ClientStore extends BaseStore {
if (this.is_logged_in && !has_client_accounts) {
localStorage.setItem(storage_key, JSON.stringify(this.accounts));
LocalStore.set(storage_key, JSON.stringify(this.accounts));
this.syncWithLegacyPlatforms(client_id, this.accounts);
}

try {
Expand All @@ -1312,6 +1318,7 @@ export default class ClientStore extends BaseStore {
this.setAccountSettings(get_settings_response.get_settings);
resolve();
});
this.syncWithLegacyPlatforms(client_id, client_accounts);
})
.catch(error => {
// eslint-disable-next-line no-console
Expand Down Expand Up @@ -1652,8 +1659,6 @@ export default class ClientStore extends BaseStore {
WS.tradingPlatformAccountsList(CFD_PLATFORMS.DERIVEZ).then(this.responseTradingPlatformAccountsList);
WS.tradingPlatformAccountsList(CFD_PLATFORMS.DERIVEZ).then(this.responseDerivezAvailableAccounts);

WS.tradingServers(CFD_PLATFORMS.DXTRADE).then(this.responseDxtradeTradingServers);

this.responseStatement(
await BinarySocket.send({
statement: 1,
Expand Down
12 changes: 1 addition & 11 deletions packages/core/src/Stores/traders-hub-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,14 @@ export default class TradersHubStore extends BaseStore {
selected_account_type;
selected_region;
is_onboarding_visited = false;
is_balance_calculating = false;
is_failed_verification_modal_visible = false;
is_regulators_compare_modal_visible = false;
is_tour_open = false;
is_account_type_modal_visible = false;
account_type_card = '';
selected_platform_type = 'options';
active_index = 0;
active_indx = 0;
open_failed_verification_for = '';
platform_demo_balance = { balance: 0, currency: 'USD' };
platform_real_balance = { balance: 0, currency: 'USD' };
cfd_demo_balance = { balance: 0, currency: 'USD' };
cfd_real_balance = { balance: 0, currency: 'USD' };
modal_data = {
active_modal: '',
data: {},
Expand All @@ -45,15 +40,11 @@ export default class TradersHubStore extends BaseStore {
available_derivez_accounts: observable,
available_mt5_accounts: observable,
available_platforms: observable,
cfd_demo_balance: observable,
cfd_real_balance: observable,
combined_cfd_mt5_accounts: observable,
is_account_transfer_modal_open: observable,
is_account_type_modal_visible: observable,
is_regulators_compare_modal_visible: observable,
is_failed_verification_modal_visible: observable,
platform_demo_balance: observable,
platform_real_balance: observable,
is_tour_open: observable,
modal_data: observable,
is_onboarding_visited: observable,
Expand Down Expand Up @@ -530,7 +521,6 @@ export default class TradersHubStore extends BaseStore {

if (is_eu && !has_maltainvest_account && standpoint?.iom) {
openAccountNeededModal('maltainvest', localize('Deriv Multipliers'), localize('demo CFDs'));

} else if (platform !== CFD_PLATFORMS.DERIVEZ) {
enableCFDPasswordModal();
} else {
Expand Down

0 comments on commit 0de6365

Please sign in to comment.