Skip to content

Commit

Permalink
Merge branch 'master' into likhith/88490/country-selection-for-non-en…
Browse files Browse the repository at this point in the history
…glish-language
  • Loading branch information
likhith-deriv committed Feb 22, 2023
2 parents 14402c6 + ac43d24 commit a6e2e97
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

0 comments on commit a6e2e97

Please sign in to comment.