Skip to content

Commit

Permalink
Merge pull request #44 from suisin-deriv/suisin/DIEL_flow_change
Browse files Browse the repository at this point in the history
Suisin/diel flow change
  • Loading branch information
shaheer-deriv committed Jun 22, 2023
2 parents 7cc8f9d + 55cf8e6 commit cd37d83
Show file tree
Hide file tree
Showing 26 changed files with 623 additions and 528 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ jobs:
build_and_test:
docker:
- image: cimg/node:18.16.0
resource_class: xlarge
resource_class: large
steps:
- git_checkout_from_cache
- npm_install_from_cache
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ const StaticDashboard = ({
{ text: localize('CFDs'), value: 1 },
];

const toggle_options_eu = [...toggle_options].reverse();

React.useEffect(() => {
const change_index_interval_id = setInterval(() => {
if (isMobile()) {
Expand Down Expand Up @@ -118,7 +120,7 @@ const StaticDashboard = ({
{isMobile() ? (
<React.Fragment>
<ButtonToggle
buttons_arr={is_eu_user ? toggle_options.reverse() : toggle_options}
buttons_arr={is_eu_user ? toggle_options_eu : toggle_options}
className='static-dashboard-wrapper__header--toggle-account'
has_rounded_button
is_animated
Expand Down Expand Up @@ -337,7 +339,7 @@ const StaticDashboard = ({
{isMobile() ? (
<React.Fragment>
<ButtonToggle
buttons_arr={is_eu_user ? toggle_options.reverse() : toggle_options}
buttons_arr={is_eu_user ? toggle_options_eu : toggle_options}
className='static-dashboard-wrapper__header--toggle-account'
has_rounded_button
is_animated
Expand Down
14 changes: 7 additions & 7 deletions packages/appstore/src/modules/onboarding/onboarding.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react';
import { useHistory } from 'react-router-dom';
import { observer } from 'mobx-react-lite';
import { localize } from '@deriv/translations';
import { useHasActiveRealAccount } from '@deriv/hooks';
import { useStore } from '@deriv/stores';
import { isMobile, isDesktop, routes, ContentFlag } from '@deriv/shared';
import { Button, Text, Icon, ProgressBarOnboarding } from '@deriv/components';
import TradigPlatformIconProps from 'Assets/svgs/trading-platform';
import { getTradingHubContents } from 'Constants/trading-hub-content';
import { useHistory } from 'react-router-dom';
import { observer } from 'mobx-react-lite';
import { useStores } from 'Stores';
import EmptyOnboarding from './empty-onboarding';

type TOnboardingProps = {
Expand All @@ -28,7 +28,7 @@ type TOnboardingProps = {
const Onboarding = ({ contents = getTradingHubContents() }: TOnboardingProps) => {
const history = useHistory();
const number_of_steps = Object.keys(contents);
const { traders_hub, client, ui } = useStores();
const { traders_hub, client, ui } = useStore();
const { toggleIsTourOpen, selectAccountType, is_demo_low_risk, content_flag } = traders_hub;
const { is_eu_country, is_logged_in, is_landing_company_loaded, prev_account_type, setPrevAccountType } = client;
const { is_from_signup_account } = ui;
Expand All @@ -54,10 +54,10 @@ const Onboarding = ({ contents = getTradingHubContents() }: TOnboardingProps) =>
const handleCloseButton = async () => {
toggleIsTourOpen(false);
history.push(routes.traders_hub);
if (has_active_real_account) {
await selectAccountType(prev_account_type);
} else {
if (content_flag === ContentFlag.EU_REAL && !has_active_real_account) {
await selectAccountType('demo');
} else {
await selectAccountType(prev_account_type);
}
};

Expand Down
4 changes: 3 additions & 1 deletion packages/appstore/src/modules/traders-hub/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ const TradersHub = () => {
{ text: localize('CFDs'), value: 'cfd' },
];

const platform_toggle_options_eu = [...platform_toggle_options].reverse();

const platformTypeChange = (event: {
target: {
value: string;
Expand Down Expand Up @@ -122,7 +124,7 @@ const TradersHub = () => {
<MobileWrapper>
{is_landing_company_loaded ? (
<ButtonToggle
buttons_arr={is_eu_user ? platform_toggle_options.reverse() : platform_toggle_options}
buttons_arr={is_eu_user ? platform_toggle_options_eu : platform_toggle_options}
className='traders-hub__button-toggle'
has_rounded_button
is_traders_hub={window.location.pathname === routes.traders_hub}
Expand Down
4 changes: 4 additions & 0 deletions packages/stores/src/mockStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ const mock = (): TStores & { is_mock: boolean } => {
is_deposit_lock: false,
is_dxtrade_allowed: false,
is_eu: false,
is_eu_country: false,
is_financial_account: false,
is_financial_information_incomplete: false,
is_low_risk: false,
Expand Down Expand Up @@ -197,6 +198,7 @@ const mock = (): TStores & { is_mock: boolean } => {
has_any_real_account: false,
real_account_creation_unlock_date: 0,
setPrevAccountType: jest.fn(),
prev_account_type: 'demo',
},
common: {
error: {
Expand Down Expand Up @@ -285,6 +287,7 @@ const mock = (): TStores & { is_mock: boolean } => {
toggleRegulatorsCompareModal: jest.fn(),
selected_region: '',
is_demo: false,
is_demo_low_risk: false,
financial_restricted_countries: false,
selected_account_type: 'real',
no_CR_account: false,
Expand All @@ -294,6 +297,7 @@ const mock = (): TStores & { is_mock: boolean } => {
setTogglePlatformType: jest.fn(),
setSelectedAccount: jest.fn(),
toggleAccountTransferModal: jest.fn(),
toggleIsTourOpen: jest.fn(),
selectAccountType: jest.fn(),
},
menu: {
Expand Down
4 changes: 4 additions & 0 deletions packages/stores/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ type TClientStore = {
is_deposit_lock: boolean;
is_dxtrade_allowed: boolean;
is_eu: boolean;
is_eu_country: boolean;
is_authorize: boolean;
is_financial_account: boolean;
is_financial_information_incomplete: boolean;
Expand All @@ -178,6 +179,7 @@ type TClientStore = {
};
loginid?: string;
pre_switch_broadcast: boolean;
prev_account_type: string;
residence: string;
responseMt5LoginList: ({
mt5_login_list,
Expand Down Expand Up @@ -363,8 +365,10 @@ type TTradersHubStore = {
is_eu_user: boolean;
setTogglePlatformType: (platform_type: string) => void;
is_real: boolean;
is_demo_low_risk: boolean;
selectRegion: (region: string) => void;
toggleRegulatorsCompareModal: () => void;
toggleIsTourOpen: (is_tour_open: boolean) => void;
selected_region: string;
openFailedVerificationModal: (selected_account_type: string) => void;
multipliers_account_status: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,36 @@ import { Localize } from '@deriv/translations';
import { Text } from '@deriv/components';

const AccumulatorTradeDescription = ({ onClick }: { onClick: () => void }) => {
const content = [
'Accumulators allow you to express a view on the range of movement of an index and grow your stake exponentially at a fixed <0>growth rate</0>.',
'Your <0>payout</0> is the sum of your inital stake and profit.',
'Your stake will continue to grow as long as the current spot price remains within a specified <0>range</0> from the <0>previous spot price</0>. Otherwise, you lose your stake and the trade is terminated.',
'You can close your trade anytime. However, be aware of <0>slippage risk<0/>.',
];

return (
<React.Fragment>
{content.map(text => (
<Text as='p' key={text.substring(0, 6)}>
<Localize
i18n_default_text={text}
components={[
<span className='contract-type-info__content-definition' onClick={onClick} key={0} />,
]}
/>
</Text>
))}
<Text as='p'>
<Localize
i18n_default_text={
'Accumulators allow you to express a view on the range of movement of an index and grow your stake exponentially at a fixed <0>growth rate</0>.'
}
components={[<span className='contract-type-info__content-definition' onClick={onClick} key={0} />]}
/>
</Text>
<Text as='p'>
<Localize
i18n_default_text={'Your <0>payout</0> is the sum of your inital stake and profit.'}
components={[<span className='contract-type-info__content-definition' onClick={onClick} key={0} />]}
/>
</Text>
<Text as='p'>
<Localize
i18n_default_text={
'Your stake will continue to grow as long as the current spot price remains within a specified <0>range</0> from the <0>previous spot price</0>. Otherwise, you lose your stake and the trade is terminated.'
}
components={[<span className='contract-type-info__content-definition' onClick={onClick} key={0} />]}
/>
</Text>
<Text as='p'>
<Localize
i18n_default_text={'You can close your trade anytime. However, be aware of <0>slippage risk<0/>.'}
components={[<span className='contract-type-info__content-definition' onClick={onClick} key={0} />]}
/>
</Text>
</React.Fragment>
);
};
Expand Down
2 changes: 1 addition & 1 deletion packages/translations/crowdin/messages.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions packages/translations/src/translations/ach.json
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@
"480356486": "crwdns1600211:0crwdne1600211:0",
"481276888": "crwdns1259651:0crwdne1259651:0",
"483279638": "crwdns1335111:0crwdne1335111:0",
"483551811": "crwdns2311043:0crwdne2311043:0",
"483591040": "crwdns1259653:0{{ delete_count }}crwdne1259653:0",
"485379166": "crwdns1259655:0crwdne1259655:0",
"487239607": "crwdns1259657:0crwdne1259657:0",
Expand All @@ -432,6 +433,7 @@
"505793554": "crwdns1259687:0crwdne1259687:0",
"508390614": "crwdns1259689:0crwdne1259689:0",
"510815408": "crwdns1259691:0crwdne1259691:0",
"511679687": "crwdns2311045:0crwdne2311045:0",
"514031715": "crwdns1259693:0{{ input_list }}crwdne1259693:0",
"514776243": "crwdns1259695:0{{account_type}}crwdne1259695:0",
"514948272": "crwdns1259697:0crwdne1259697:0",
Expand Down Expand Up @@ -1817,6 +1819,7 @@
"1995023783": "crwdns1262047:0crwdne1262047:0",
"1996767628": "crwdns1262049:0crwdne1262049:0",
"1997138507": "crwdns1262051:0crwdne1262051:0",
"1997313835": "crwdns2311047:0crwdne2311047:0",
"1998199587": "crwdns1262053:0crwdne1262053:0",
"2001222130": "crwdns1262055:0crwdne1262055:0",
"2004395123": "crwdns1233583:0crwdne1233583:0",
Expand Down Expand Up @@ -3540,6 +3543,7 @@
"-1900883796": "crwdns1781107:0{{trade_type}}crwdnd1781107:0{{payout_status}}crwdne1781107:0",
"-347156282": "crwdns1807479:0crwdne1807479:0",
"-1738427539": "crwdns69912:0crwdne69912:0",
"-1937372493": "crwdns2311049:0crwdne2311049:0",
"-1422269966": "crwdns2301213:0crwdne2301213:0",
"-1186791513": "crwdns2301215:0crwdne2301215:0",
"-1682624802": "crwdns2301217:0crwdne2301217:0",
Expand Down
Loading

0 comments on commit cd37d83

Please sign in to comment.