Skip to content

Commit

Permalink
Sergei / 88801 / Add button does not allow to add crypto accounts und…
Browse files Browse the repository at this point in the history
…er Non EU Deriv Account when inside of Traders Hub (#7648)

* fix: add crypto for EU

* fix: change modal height and define crypto array

---------

Co-authored-by: amina-deriv <84661147+amina-deriv@users.noreply.github.com>
  • Loading branch information
sergei-deriv and amina-deriv committed Feb 22, 2023
1 parent d11d673 commit ac43d24
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ const AddOrManageAccounts = props => {
setShouldShowCancel,
onClose,
show_eu_related_content,
is_low_risk,
is_pre_appstore,
} = props;

const initial_active_index =
Expand Down Expand Up @@ -138,7 +140,7 @@ const AddOrManageAccounts = props => {

return (
<ThemedScrollbars is_bypassed={isMobile()} autohide={false}>
{show_eu_related_content && has_fiat ? (
{show_eu_related_content && !(is_low_risk && is_pre_appstore) && has_fiat ? (
fiat_section
) : (
<Tabs
Expand Down Expand Up @@ -216,6 +218,8 @@ AddOrManageAccounts.propTypes = {
setIsDeposit: PropTypes.func,
manage_real_account_tab_index: PropTypes.number,
show_eu_related_content: PropTypes.bool,
is_low_risk: PropTypes.bool,
is_pre_appstore: PropTypes.bool,
};

export default connect(({ client, modules, ui, traders_hub }) => ({
Expand All @@ -231,4 +235,6 @@ export default connect(({ client, modules, ui, traders_hub }) => ({
resetRealAccountSignupTarget: ui.resetRealAccountSignupTarget,
setIsDeposit: modules.cashier.general_store.setIsDeposit,
show_eu_related_content: traders_hub.show_eu_related_content,
is_low_risk: client.is_low_risk,
is_pre_appstore: client.is_pre_appstore,
}))(AddOrManageAccounts);
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ const RealAccountSignup = ({
should_show_risk_warning_modal,
state_index,
state_value,
is_low_risk,
}) => {
const [current_action, setCurrentAction] = React.useState(null);
const [is_loading, setIsLoading] = React.useState(false);
Expand Down Expand Up @@ -260,7 +261,11 @@ const RealAccountSignup = ({
if (getActiveModalIndex() === modal_pages_indices.status_dialog) return 'auto';
if (!currency) return '688px'; // Set currency modal
if (has_real_account && currency) {
if (show_eu_related_content && getActiveModalIndex() === modal_pages_indices.add_or_manage_account) {
if (
show_eu_related_content &&
!(is_pre_appstore && is_low_risk) &&
getActiveModalIndex() === modal_pages_indices.add_or_manage_account
) {
// Manage account
return '420px'; // Since crypto is disabled for EU clients, lower the height of modal
}
Expand Down Expand Up @@ -656,4 +661,5 @@ export default connect(({ ui, client, common, traders_hub, modules }) => ({
should_show_risk_warning_modal: ui.should_show_risk_warning_modal,
state_value: ui.real_account_signup,
show_eu_related_content: traders_hub.show_eu_related_content,
is_low_risk: client.is_low_risk,
}))(withRouter(RealAccountSignup));
8 changes: 6 additions & 2 deletions packages/core/src/Stores/client-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,15 +531,19 @@ export default class ClientStore extends BaseStore {
return [];
};

if (!this.landing_companies || !this.root_store.ui) return [];
if (!this.landing_companies || !this.root_store.ui) {
return [];
}
if (!this.root_store.ui.real_account_signup_target) {
return getDefaultAllowedCurrencies();
}
if (
['set_currency', 'manage'].includes(this.root_store.ui.real_account_signup_target) &&
this.current_landing_company
) {
return this.current_landing_company.legal_allowed_currencies;
return this.is_pre_appstore
? getDefaultAllowedCurrencies()
: this.current_landing_company.legal_allowed_currencies;
}
const target = this.root_store.ui.real_account_signup_target === 'maltainvest' ? 'financial' : 'gaming';

Expand Down

1 comment on commit ac43d24

@vercel
Copy link

@vercel vercel bot commented on ac43d24 Feb 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-app – ./

binary.sx
deriv-app.binary.sx
deriv-app-git-master.binary.sx
deriv-app.vercel.app

Please sign in to comment.