diff --git a/packages/account/src/Components/Routes/__tests__/route-with-sub-routes.spec.tsx b/packages/account/src/Components/Routes/__tests__/route-with-sub-routes.spec.tsx index 6ab27da42485..d0ec96edeb31 100644 --- a/packages/account/src/Components/Routes/__tests__/route-with-sub-routes.spec.tsx +++ b/packages/account/src/Components/Routes/__tests__/route-with-sub-routes.spec.tsx @@ -2,7 +2,6 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; import { RouteWithSubRoutesRender } from '../route-with-sub-routes'; import { Redirect } from 'react-router-dom'; -import { PlatformContext } from '@deriv/shared'; jest.mock('react-router-dom', () => ({ ...jest.requireActual('react-router-dom'), @@ -21,22 +20,14 @@ afterEach(() => { describe('', () => { it('should render one component', () => { - render( - - - - ); + render(); expect(screen.getByText(/Route loaded/)).toBeInTheDocument(); }); it('should have props as passed as route', () => { const route = { path: '/test', component: Redirect, title: '', exact: true, to: '/root' }; - render( - - - - ); + render(); expect(screen.getByText(/route loaded true \/test/i)).toBeInTheDocument(); }); }); diff --git a/packages/account/src/Components/account-limits/__tests__/account-limits.spec.tsx b/packages/account/src/Components/account-limits/__tests__/account-limits.spec.tsx index f521a336dcdd..a724344cb2ca 100644 --- a/packages/account/src/Components/account-limits/__tests__/account-limits.spec.tsx +++ b/packages/account/src/Components/account-limits/__tests__/account-limits.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { screen, render } from '@testing-library/react'; -import { formatMoney, isDesktop, isMobile, PlatformContext } from '@deriv/shared'; +import { formatMoney, isDesktop, isMobile } from '@deriv/shared'; import AccountLimits from '../account-limits'; import { BrowserRouter } from 'react-router-dom'; import { StoreProvider, mockStore } from '@deriv/stores'; @@ -362,7 +362,7 @@ describe('', () => { ).toBeInTheDocument(); }); - it('withdrawal_limits_table should show `Total withdrawal limit` if is_fully_authenticated is false and is_appstore is true', () => { + it('withdrawal_limits_table should show `Total withdrawal allowed` when is_fully_authenticated is false', () => { store = mockStore({ client: { ...mock.client, @@ -370,86 +370,14 @@ describe('', () => { }, }); render( - - - - - - - - ); - expect(screen.getByText(/total withdrawal limit/i)).toBeInTheDocument(); - }); - - it('withdrawal_limits_table should show `Total withdrawal allowed` when is_fully_authenticated is false and is_appstore is true', () => { - store = mockStore({ - client: { - ...mock.client, - is_fully_authenticated: false, - }, - }); - render( - - - - - + + + ); expect(screen.getByText(/total withdrawal allowed/i)).toBeInTheDocument(); }); - it('withdrawal_limits_table should show the verfiy button when is_fully_authenticated is false and is_appstore is true', () => { - store = mockStore({ - client: { - ...mock.client, - is_fully_authenticated: false, - }, - }); - render( - - - - - - - - ); - expect(screen.getByText(/to increase limit please verify your identity/i)).toBeInTheDocument(); - expect( - screen.getByRole('link', { - name: /verify/i, - }) - ).toHaveAttribute('href', '/account/proof-of-identity'); - const { num_of_days_limit } = store.client.account_limits; - expect(formatMoney).toHaveBeenCalledWith(store.client.currency, num_of_days_limit, true); - }); - - it('withdrawal_limits_table should show total withdrawn and withdrawn remaining details', () => { - store = mockStore({ - client: { - ...mock.client, - is_fully_authenticated: false, - }, - }); - render( - - - - - - - - ); - const { withdrawal_since_inception_monetary, remainder } = store.client.account_limits; - - expect(screen.getByText(/total withdrawn/i)).toBeInTheDocument(); - expect(formatMoney).toHaveBeenCalledWith(store.client.currency, withdrawal_since_inception_monetary, true); - - expect(screen.getByText(/maximum withdrawal remaining/i)).toBeInTheDocument(); - expect(formatMoney).toHaveBeenCalledWith(store.client.currency, remainder, true); - }); - - it('should show limit_notice message when is_appstore is false and is_fully_authenticated is false in mobile mode', () => { + it('should show limit_notice message when is_fully_authenticated is false in mobile mode', () => { store = mockStore({ client: { ...mock.client, @@ -459,18 +387,16 @@ describe('', () => { (isMobile as jest.Mock).mockReturnValue(true); (isDesktop as jest.Mock).mockReturnValue(false); render( - - - - - - - + + + + + ); expect(screen.getByText(/stated limits are subject to change without prior notice\./i)).toBeInTheDocument(); }); - it('should not show limit_notice message when is_appstore is false and is_fully_authenticated is false', () => { + it('should not show limit_notice message when is_fully_authenticated is false', () => { store = mockStore({ client: { ...mock.client, @@ -480,13 +406,11 @@ describe('', () => { (isMobile as jest.Mock).mockReturnValue(false); (isDesktop as jest.Mock).mockReturnValue(true); render( - - - - - - - + + + + + ); expect( screen.queryByText(/your account is fully authenticated and your withdrawal limits have been lifted\./i) diff --git a/packages/account/src/Components/account-limits/account-limits.tsx b/packages/account/src/Components/account-limits/account-limits.tsx index 171b0e5749b7..49517a7f94a2 100644 --- a/packages/account/src/Components/account-limits/account-limits.tsx +++ b/packages/account/src/Components/account-limits/account-limits.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { FormikValues } from 'formik'; import classNames from 'classnames'; -import { formatMoney, isDesktop, isMobile, useIsMounted, PlatformContext } from '@deriv/shared'; +import { formatMoney, isDesktop, isMobile, useIsMounted } from '@deriv/shared'; import { Loading, ThemedScrollbars } from '@deriv/components'; import { Localize, localize } from '@deriv/translations'; import { observer, useStore } from '@deriv/stores'; @@ -37,19 +37,10 @@ const AccountLimits = observer( should_show_article = true, }: TAccountLimits) => { const { client } = useStore(); - const { - account_limits, - account_status, - currency, - getLimits, - is_fully_authenticated, - is_virtual, - is_switching, - } = client; + const { account_limits, account_status, currency, getLimits, is_virtual, is_switching } = client; const isMounted = useIsMounted(); const [is_loading, setLoading] = React.useState(true); const [is_overlay_shown, setIsOverlayShown] = React.useState(false); - const { is_appstore } = React.useContext(PlatformContext); const handleGetLimitsResponse = () => { if (isMounted()) setLoading(false); @@ -84,13 +75,8 @@ const AccountLimits = observer( if (is_virtual) { return ( -
- +
+
); } @@ -237,7 +223,6 @@ const AccountLimits = observer( {!is_app_settings && ( { - return is_appstore ? ( - - ) : ( - - ); -}; - -const AccountLimitsVerificationNotice = observer(({ is_appstore }: { is_appstore: boolean }) => { - const { client } = useStore(); - const { is_fully_authenticated } = client; - return ( - - - {is_appstore && !is_fully_authenticated && ( - - - {localize('To increase limit please verify your identity')} - - - - {localize('Verify')} - - - - )} - - ); -}); - const WithdrawalLimitsTable = observer( - ({ is_appstore, num_of_days_limit, withdrawal_since_inception_monetary, remainder }: TWithdrawalLimitsTable) => { + ({ num_of_days_limit, withdrawal_since_inception_monetary, remainder }: TWithdrawalLimitsTable) => { const { client } = useStore(); const { currency, is_fully_authenticated } = client; return ( @@ -76,7 +36,7 @@ const WithdrawalLimitsTable = observer( - + {formatMoney(currency, num_of_days_limit ?? 0, true)} @@ -102,17 +62,15 @@ const WithdrawalLimitsTable = observer( )} - {!is_appstore && ( -
- - {is_fully_authenticated ? ( - - ) : ( - - )} - -
- )} +
+ + {is_fully_authenticated ? ( + + ) : ( + + )} + +
); } diff --git a/packages/account/src/Components/demo-message/demo-message.tsx b/packages/account/src/Components/demo-message/demo-message.tsx index 796e2d757bb8..1cb8c1366ebe 100644 --- a/packages/account/src/Components/demo-message/demo-message.tsx +++ b/packages/account/src/Components/demo-message/demo-message.tsx @@ -3,13 +3,12 @@ import { localize } from '@deriv/translations'; import IconWithMessage from '../icon-with-message'; type TDemoMessage = { - has_demo_icon?: boolean; has_button?: boolean; }; -const DemoMessage = ({ has_demo_icon, has_button }: TDemoMessage) => ( +const DemoMessage = ({ has_button }: TDemoMessage) => ( diff --git a/packages/account/src/Components/poi/missing-personal-details/__tests__/missing-personal-details.spec.tsx b/packages/account/src/Components/poi/missing-personal-details/__tests__/missing-personal-details.spec.tsx index 1a30c4cc71a6..624404611a10 100644 --- a/packages/account/src/Components/poi/missing-personal-details/__tests__/missing-personal-details.spec.tsx +++ b/packages/account/src/Components/poi/missing-personal-details/__tests__/missing-personal-details.spec.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { BrowserRouter } from 'react-router-dom'; import { render, screen } from '@testing-library/react'; -import { PlatformContext } from '@deriv/shared'; import { MissingPersonalDetails } from '../missing-personal-details'; jest.mock('@deriv/components', () => { @@ -13,12 +12,7 @@ jest.mock('@deriv/components', () => { }); describe('', () => { - const renderWithRouter = component => - render( - - {component} - - ); + const renderWithRouter = component => render({component}); it('should render the MissingPersonalDetails component', () => { renderWithRouter(); @@ -45,14 +39,14 @@ describe('', () => { expect(btn.hasAttribute('/account/personal-details?from=proof_of_identity#address_postcode')); }); - it('should show missing msg with proper icon if has_invalid_postal_code is false and is_appstore is true', () => { + it('should show missing msg with proper icon if has_invalid_postal_code is false', () => { renderWithRouter(); expect(screen.getByText(/your personal details are missing/i)).toBeInTheDocument(); expect( screen.getByText(/please complete your personal details before you verify your identity\./i) ).toBeInTheDocument(); - expect(screen.getByText('IcAccountMissingDetailsDashboard')).toBeInTheDocument(); + expect(screen.getByText('IcAccountMissingDetails')).toBeInTheDocument(); const btn = screen.getByRole('link', { name: /go to personal details/i }); expect(btn).toBeInTheDocument(); @@ -60,13 +54,11 @@ describe('', () => { expect(btn.hasAttribute('/account/personal-details?from=proof_of_identity')); }); - it('should show missing msg with proper icon if has_invalid_postal_code is false and is_appstore is false', () => { + it('should show missing msg with proper icon if has_invalid_postal_code is false', () => { render( - - - - - + + + ); expect(screen.getByText(/your personal details are missing/i)).toBeInTheDocument(); diff --git a/packages/account/src/Components/poi/missing-personal-details/missing-personal-details.tsx b/packages/account/src/Components/poi/missing-personal-details/missing-personal-details.tsx index 2bac32dffd70..1ff0bcea9425 100644 --- a/packages/account/src/Components/poi/missing-personal-details/missing-personal-details.tsx +++ b/packages/account/src/Components/poi/missing-personal-details/missing-personal-details.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import { PlatformContext } from '@deriv/shared'; import { ButtonLink, Icon, Text } from '@deriv/components'; import { localize } from '@deriv/translations'; import IconMessageContent from '../../icon-message-content'; @@ -24,7 +23,6 @@ const GoToPersonalDetailsButton = ({ anchor, from, text }: TGoToPersonalDetailsB }; export const MissingPersonalDetails = ({ has_invalid_postal_code, from }: TGoToPersonalDetailsButton) => { - const { is_appstore } = React.useContext(PlatformContext); if (has_invalid_postal_code) return ( - } + icon={} > diff --git a/packages/account/src/Components/poi/status/upload-complete/__tests__/upload-complete.spec.tsx b/packages/account/src/Components/poi/status/upload-complete/__tests__/upload-complete.spec.tsx index d6225d9e7c56..0420e56a10d9 100644 --- a/packages/account/src/Components/poi/status/upload-complete/__tests__/upload-complete.spec.tsx +++ b/packages/account/src/Components/poi/status/upload-complete/__tests__/upload-complete.spec.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; import { Button } from '@deriv/components'; -import { PlatformContext } from '@deriv/shared'; import { UploadComplete } from '../upload-complete'; import { BrowserRouter } from 'react-router-dom'; @@ -23,21 +22,10 @@ describe('', () => { const redirect_button = ; const needs_poa_extra_submit_message = /you must also submit a proof of address./i; - const renderWithRouter = (component, is_appstore) => - render( - - {component} - - ); - - it('should display Icon if is_appstore is false', () => { - renderWithRouter(, false); - - expect(screen.getByTestId(/dt_mocked_icon/)).toBeInTheDocument(); - }); + const renderWithRouter = component => render({component}); it('should render component for manual upload', () => { - renderWithRouter(, true); + renderWithRouter(); expect(screen.getByText(successful_upload_message)).toBeInTheDocument(); expect(screen.getByText(poi_under_review_message_for_manual)).toBeInTheDocument(); @@ -45,7 +33,7 @@ describe('', () => { expect(screen.queryByRole('button')).not.toBeInTheDocument(); }); it('should render component for manual upload', () => { - renderWithRouter(, true); + renderWithRouter(); expect(screen.getByText(successful_upload_message)).toBeInTheDocument(); expect(screen.getByText(poi_under_review_message_for_manual)).toBeInTheDocument(); @@ -54,19 +42,19 @@ describe('', () => { }); it('should not show redirect_button if it redirect_button passed and is_from_external is true, but needs_poa is false', () => { - renderWithRouter(, true); + renderWithRouter(); expect(screen.queryByRole('button')).not.toBeInTheDocument(); }); it('should show redirect button if needs_poa and is_from_external are false and have redirect button', () => { - renderWithRouter(, true); + renderWithRouter(); expect(screen.getByRole('button')).toBeInTheDocument(); }); it('should show needs_poa review message and extra submission message, and poa_buttons', () => { - renderWithRouter(, true); + renderWithRouter(); expect(screen.getByTestId('dt_poa_button')).toBeInTheDocument(); expect(screen.getByText(poi_under_review_message)).toBeInTheDocument(); @@ -75,7 +63,7 @@ describe('', () => { }); it('should show needs_poa review message and extra submission message, and poa_buttons but redirect_button will not display', () => { - renderWithRouter(, true); + renderWithRouter(); expect(screen.getByTestId('dt_poa_button')).toBeInTheDocument(); expect(screen.getByText(poi_under_review_message)).toBeInTheDocument(); diff --git a/packages/account/src/Components/poi/status/upload-complete/upload-complete.tsx b/packages/account/src/Components/poi/status/upload-complete/upload-complete.tsx index a483e233eb70..e0ed002c5e78 100644 --- a/packages/account/src/Components/poi/status/upload-complete/upload-complete.tsx +++ b/packages/account/src/Components/poi/status/upload-complete/upload-complete.tsx @@ -1,12 +1,11 @@ import React from 'react'; import { Icon, Text } from '@deriv/components'; -import { PlatformContext, isNavigationFromP2P, isNavigationFromDerivGO } from '@deriv/shared'; +import { isNavigationFromP2P, isNavigationFromDerivGO } from '@deriv/shared'; import { localize } from '@deriv/translations'; import PoaButton from '../../../poa/poa-button'; import { ContinueTradingButton } from '../../../poa/continue-trading-button/continue-trading-button'; import IconMessageContent from '../../../icon-message-content/icon-message-content'; -import { TPlatformContext, TPOIStatus } from 'Types'; -import classNames from 'classnames'; +import { TPOIStatus } from 'Types'; export const UploadComplete = ({ needs_poa, @@ -14,7 +13,6 @@ export const UploadComplete = ({ is_from_external, is_manual_upload = false, }: TPOIStatus) => { - const { is_appstore } = React.useContext(PlatformContext); const message = localize('Your documents were submitted successfully'); const description = is_manual_upload ? localize('We’ll review your documents and notify you of its status within 1 - 3 working days.') @@ -24,40 +22,19 @@ export const UploadComplete = ({ if (!needs_poa) { return ( - - ) : ( - - ) - } - className={classNames({ 'account-management-dashboard': is_appstore })} - > + }> {!is_from_external && (redirect_button || (!is_redirected_from_platform && ))} ); } return ( - - ) : ( - - ) - } - className={classNames({ 'account-management-dashboard': is_appstore })} - > + }>
- + {description} - + {localize('You must also submit a proof of address.')}
diff --git a/packages/account/src/Components/self-exclusion/__tests__/self-exclusion-article.spec.tsx b/packages/account/src/Components/self-exclusion/__tests__/self-exclusion-article.spec.tsx index faf26f0039dc..ffa9d0b5d8c0 100644 --- a/packages/account/src/Components/self-exclusion/__tests__/self-exclusion-article.spec.tsx +++ b/packages/account/src/Components/self-exclusion/__tests__/self-exclusion-article.spec.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import { PlatformContext } from '@deriv/shared'; import { fireEvent, render, screen } from '@testing-library/react'; import SelfExclusionArticle from '../self-exclusion-article'; import { selfExclusionArticleItems } from 'Components/self-exclusion/self-exclusion-article-content'; @@ -12,10 +11,6 @@ jest.mock('Components/self-exclusion/self-exclusion-article-content', () => ({ })); describe('', () => { - let mock_platform_context = { - is_appstore: false, - is_deriv_crypto: false, - }; let mock_self_exclusion_context = { is_app_settings: false, is_eu: false, @@ -31,10 +26,6 @@ describe('', () => { /these self-exclusion limits help you control the amount of money and time you spend trading on deriv trader, deriv bot, smarttrader and binary bot on deriv. the limits you set here will help you exercise/i; beforeEach(() => { - mock_platform_context = { - is_appstore: false, - is_deriv_crypto: false, - }; mock_self_exclusion_context = { is_app_settings: false, is_eu: false, @@ -57,11 +48,9 @@ describe('', () => { render( - - - - - + + + ); @@ -81,11 +70,9 @@ describe('', () => { render( - - - - - + + + ); @@ -104,11 +91,9 @@ describe('', () => { render( - - - - - + + + ); @@ -128,11 +113,9 @@ describe('', () => { render( - - - - - + + + ); diff --git a/packages/account/src/Components/self-exclusion/__tests__/self-exclusion-inputs.spec.tsx b/packages/account/src/Components/self-exclusion/__tests__/self-exclusion-inputs.spec.tsx index fca2908a32de..6930c80b915e 100644 --- a/packages/account/src/Components/self-exclusion/__tests__/self-exclusion-inputs.spec.tsx +++ b/packages/account/src/Components/self-exclusion/__tests__/self-exclusion-inputs.spec.tsx @@ -16,7 +16,6 @@ let mock_context: TSelfExclusionContext = { footer_ref: undefined, getMaxLength: jest.fn(), goToConfirm: jest.fn(), - is_appstore: false, is_app_settings: false, is_eu: false, is_mf: false, @@ -64,7 +63,6 @@ describe('', () => { footer_ref: undefined, getMaxLength: jest.fn(), goToConfirm: jest.fn(), - is_appstore: false, is_app_settings: false, is_eu: false, is_mf: false, diff --git a/packages/account/src/Components/self-exclusion/self-exclusion-article-content.tsx b/packages/account/src/Components/self-exclusion/self-exclusion-article-content.tsx index b60b72c012e0..8f25a7cd264d 100644 --- a/packages/account/src/Components/self-exclusion/self-exclusion-article-content.tsx +++ b/packages/account/src/Components/self-exclusion/self-exclusion-article-content.tsx @@ -1,18 +1,18 @@ import classNames from 'classnames'; import * as React from 'react'; import PropTypes from 'prop-types'; -import { getStaticUrl, PlatformContext } from '@deriv/shared'; +import { getStaticUrl } from '@deriv/shared'; import { Localize, localize } from '@deriv/translations'; import { Button, Icon, OpenLiveChatLink, Popup, Text } from '@deriv/components'; import SelfExclusionContext from './self-exclusion-context'; -type TSelfExclusionArticleItems = Record<'is_eu' | 'is_deriv_crypto' | 'is_app_settings', boolean | undefined>; +type TSelfExclusionArticleItems = Record<'is_eu' | 'is_app_settings', boolean | undefined>; type TSelfExclusionArticleContent = { is_in_overlay: boolean; }; -export const selfExclusionArticleItems = ({ is_eu, is_deriv_crypto, is_app_settings }: TSelfExclusionArticleItems) => { +export const selfExclusionArticleItems = ({ is_eu, is_app_settings }: TSelfExclusionArticleItems) => { const getEuItems = () => { const eu_items = [ { @@ -25,7 +25,7 @@ export const selfExclusionArticleItems = ({ is_eu, is_deriv_crypto, is_app_setti className='link' rel='noopener noreferrer' target='_blank' - href={getStaticUrl('/responsible', { is_deriv_crypto })} + href={getStaticUrl('/responsible')} />, ]} /> @@ -57,7 +57,7 @@ export const selfExclusionArticleItems = ({ is_eu, is_deriv_crypto, is_app_setti className='link' rel='noopener noreferrer' target='_blank' - href={getStaticUrl('/contact_us', { is_deriv_crypto })} + href={getStaticUrl('/contact_us')} />, ]} /> @@ -79,7 +79,7 @@ export const selfExclusionArticleItems = ({ is_eu, is_deriv_crypto, is_app_setti className='link' rel='noopener noreferrer' target='_blank' - href={getStaticUrl('/responsible', { is_deriv_crypto })} + href={getStaticUrl('/responsible')} />, ]} /> @@ -121,9 +121,8 @@ export const selfExclusionArticleItems = ({ is_eu, is_deriv_crypto, is_app_setti const SelfExclusionArticleContent = ({ is_in_overlay }: Partial) => { const { is_app_settings, toggleArticle, overlay_ref, is_eu } = React.useContext(SelfExclusionContext); - const { is_deriv_crypto } = React.useContext(PlatformContext); - const keyed_article_items = selfExclusionArticleItems({ is_eu, is_deriv_crypto, is_app_settings }); + const keyed_article_items = selfExclusionArticleItems({ is_eu, is_app_settings }); if (is_in_overlay) { return ( void; goToConfirm?: (value: FormikValues) => void; handleSubmit: (values: FormikValues, setSubmitting: FormikHelpers) => void; - is_appstore?: boolean; is_app_settings?: boolean; is_eu?: boolean; is_mf?: boolean; diff --git a/packages/account/src/Components/self-exclusion/self-exclusion-inputs.tsx b/packages/account/src/Components/self-exclusion/self-exclusion-inputs.tsx index c2bd9878a16c..fd7c0e81a623 100644 --- a/packages/account/src/Components/self-exclusion/self-exclusion-inputs.tsx +++ b/packages/account/src/Components/self-exclusion/self-exclusion-inputs.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import classNames from 'classnames'; import { Button, DatePicker, Input, Text } from '@deriv/components'; -import { epochToMoment, toMoment, PlatformContext, isMobile } from '@deriv/shared'; +import { epochToMoment, toMoment, isMobile } from '@deriv/shared'; import { Localize, localize } from '@deriv/translations'; import { Field, @@ -192,14 +192,10 @@ const SessionAndLoginLimitsInputs = () => { const { is_tablet, session_duration_digits } = React.useContext(SelfExclusionContext); const { errors, handleBlur, handleChange, setFieldValue, values }: TFormikContext = useFormikContext(); - const { is_appstore } = React.useContext(PlatformContext); return ( - } - has_border_line={is_appstore} - /> + } />
@@ -286,14 +282,10 @@ const SessionAndLoginLimitsInputs = () => { const MaximumAccountBalanceAndOpenPositionsInputs = () => { const { currency_display, getMaxLength } = React.useContext(SelfExclusionContext); const { errors, handleBlur, handleChange, values }: TFormikContext = useFormikContext(); - const { is_appstore } = React.useContext(PlatformContext); return ( - } - has_border_line={is_appstore} - /> + } />
@@ -345,7 +337,6 @@ const MaximumAccountBalanceAndOpenPositionsInputs = () => { const MaximumDepositLimitInputs = () => { const { currency, is_mf, getMaxLength } = React.useContext(SelfExclusionContext); const { errors, handleBlur, handleChange, values }: TFormikContext = useFormikContext(); - const { is_appstore } = React.useContext(PlatformContext); if (!is_mf) { return null; @@ -353,10 +344,7 @@ const MaximumDepositLimitInputs = () => { return ( - } - has_border_line={is_appstore} - /> + } />

@@ -436,19 +424,9 @@ const MaximumDepositLimitInputs = () => { }; const SelfExclusionInputs = () => { - const { is_appstore } = React.useContext(PlatformContext); const { footer_ref, goToConfirm, is_app_settings } = React.useContext(SelfExclusionContext); const { dirty, isSubmitting, isValid, values }: TFormikContext = useFormikContext(); const versions: Record }> = { - // Global settings for account for DWallet. - dwallet: { - condition: !!is_appstore, - components: [ - SessionAndLoginLimitsInputs, - MaximumAccountBalanceAndOpenPositionsInputs, - MaximumDepositLimitInputs, - ], - }, // App-specific settings, i.e. user accessing app settings from App Store or // through DWallet App header. app_settings: { @@ -457,7 +435,7 @@ const SelfExclusionInputs = () => { }, // Legacy Deriv.app, i.e. non-DWallet user accessing app.deriv.com/account/self-exclusion. deriv_app: { - condition: !!(!is_appstore && !is_app_settings), + condition: !is_app_settings, components: [ StakeLossAndLimitsInputs, SessionAndLoginLimitsInputs, diff --git a/packages/account/src/Configs/personal-details-config.ts b/packages/account/src/Configs/personal-details-config.ts index c34c6e583623..f049cfb65821 100644 --- a/packages/account/src/Configs/personal-details-config.ts +++ b/packages/account/src/Configs/personal-details-config.ts @@ -237,8 +237,7 @@ const personalDetailsConfig = ( account_status, residence, }: TPersonalDetailsConfig, - PersonalDetails: T, - is_appstore = false + PersonalDetails: T ) => { const config = personal_details_config({ residence_list, @@ -250,8 +249,8 @@ const personalDetailsConfig = ( const disabled_items = account_settings.immutable_fields; return { header: { - active_title: is_appstore ? localize('A few personal details') : localize('Complete your personal details'), - title: is_appstore ? localize('PERSONAL') : localize('Personal details'), + active_title: localize('Complete your personal details'), + title: localize('Personal details'), }, body: PersonalDetails, form_value: getDefaultFields(real_account_signup_target, config), diff --git a/packages/account/src/Sections/Security/AccountClosed/account-closed.tsx b/packages/account/src/Sections/Security/AccountClosed/account-closed.tsx index 1547cd86586e..c73992325596 100644 --- a/packages/account/src/Sections/Security/AccountClosed/account-closed.tsx +++ b/packages/account/src/Sections/Security/AccountClosed/account-closed.tsx @@ -2,22 +2,21 @@ import React from 'react'; import { Modal, Text } from '@deriv/components'; import { Localize } from '@deriv/translations'; import { observer, useStore } from '@deriv/stores'; -import { getStaticUrl, PlatformContext } from '@deriv/shared'; +import { getStaticUrl } from '@deriv/shared'; const AccountClosed = observer(() => { const { client } = useStore(); const { logout } = client; const [is_modal_open, setModalState] = React.useState(true); const [timer, setTimer] = React.useState(10); - const { is_appstore } = React.useContext(PlatformContext); const counter = React.useCallback(() => { if (timer > 0) { setTimer(timer - 1); } else { - window.location.href = getStaticUrl('/', { is_appstore }); + window.location.href = getStaticUrl('/'); } - }, [is_appstore, timer]); + }, [timer]); React.useEffect(() => { window.history.pushState(null, '', '/'); diff --git a/packages/cfd/src/Components/Routes/binary-link.jsx b/packages/cfd/src/Components/Routes/binary-link.jsx index c92428bdea66..a50bc31c95f4 100644 --- a/packages/cfd/src/Components/Routes/binary-link.jsx +++ b/packages/cfd/src/Components/Routes/binary-link.jsx @@ -1,14 +1,12 @@ import PropTypes from 'prop-types'; import React from 'react'; import { NavLink } from 'react-router-dom'; -import { PlatformContext } from '@deriv/shared'; import getRoutesConfig from '../../Constants/routes-config'; import { findRouteByPath, normalizePath } from './helpers'; const BinaryLink = ({ active_class, to, children, ...props }) => { - const { is_dashboard } = React.useContext(PlatformContext); const path = normalizePath(to); - const route = findRouteByPath(path, getRoutesConfig({ is_dashboard })); + const route = findRouteByPath(path, getRoutesConfig()); if (!route) { throw new Error(`Route not found: ${to}`); diff --git a/packages/cfd/src/Components/Routes/binary-routes.jsx b/packages/cfd/src/Components/Routes/binary-routes.jsx index a75cc6de0f81..2572f1c13fe8 100644 --- a/packages/cfd/src/Components/Routes/binary-routes.jsx +++ b/packages/cfd/src/Components/Routes/binary-routes.jsx @@ -1,13 +1,10 @@ import React from 'react'; import { Switch } from 'react-router-dom'; -import { PlatformContext } from '@deriv/shared'; import { Localize } from '@deriv/translations'; import getRoutesConfig from '../../Constants/routes-config'; import RouteWithSubRoutes from './route-with-sub-routes.jsx'; const BinaryRoutes = props => { - const { is_dashboard } = React.useContext(PlatformContext); - return ( { @@ -19,7 +16,7 @@ const BinaryRoutes = props => { }} > - {getRoutesConfig({ is_dashboard }).map(route => ( + {getRoutesConfig().map(route => ( ))} diff --git a/packages/cfd/src/Containers/props.types.ts b/packages/cfd/src/Containers/props.types.ts index 5acf5aa0d776..b2d0694d2cdf 100644 --- a/packages/cfd/src/Containers/props.types.ts +++ b/packages/cfd/src/Containers/props.types.ts @@ -288,7 +288,6 @@ export type TCompareAccountRowProps = TCompareAccountContentProps & { available_accounts_count: number; classname_for_demo_and_eu: string | null; content_flag: string; - is_pre_appstore_setting: boolean; pre_appstore_class: string; is_high_risk_for_mt5: boolean; CFDs_restricted_countries: boolean; @@ -309,7 +308,6 @@ export type TDMT5CompareModalContentProps = { content_flag: string; is_demo_tab: boolean; is_logged_in: boolean; - is_pre_appstore_setting: boolean; is_preappstore_cr_demo_account: boolean; is_preappstore_restricted_cr_demo_account: boolean; is_real_enabled: boolean; diff --git a/packages/cfd/src/features/types/containers.types.ts b/packages/cfd/src/features/types/containers.types.ts index a55428ebcf3b..fd9776e351c4 100644 --- a/packages/cfd/src/features/types/containers.types.ts +++ b/packages/cfd/src/features/types/containers.types.ts @@ -283,7 +283,6 @@ export type TCompareAccountRowProps = TCompareAccountContentProps & { pre_appstore_class: string; is_high_risk_for_mt5: boolean; available_accounts_count: number; - is_pre_appstore_setting: boolean; CFDs_restricted_countries: boolean; financial_restricted_countries: boolean; classname_for_demo_and_eu: string | null; @@ -304,7 +303,6 @@ export type TDMT5CompareModalContentProps = { is_logged_in: boolean; is_real_enabled: boolean; should_show_derivx: boolean; - is_pre_appstore_setting: boolean; show_eu_related_content: boolean; toggleCompareAccounts: () => void; is_preappstore_cr_demo_account: boolean; diff --git a/packages/components/src/components/send-email-template/send-email-template.tsx b/packages/components/src/components/send-email-template/send-email-template.tsx index e3273b37337d..b706b11af1b1 100644 --- a/packages/components/src/components/send-email-template/send-email-template.tsx +++ b/packages/components/src/components/send-email-template/send-email-template.tsx @@ -1,6 +1,4 @@ import React from 'react'; -import classNames from 'classnames'; -import { PlatformContext } from '@deriv/shared'; import Icon from '../icon/icon'; import Button from '../button/button'; import Text from '../text'; @@ -32,7 +30,6 @@ const SendEmailTemplate = ({ const [is_email_not_received_clicked, setIsEmailNotReceivedClicked] = React.useState(false); const [is_resend_btn_disabled, setIsResendBtnDisabled] = React.useState(false); const [resend_email_btn_text, setResendEmailBtnText] = React.useState(txt_resend); - const { is_appstore }: { is_appstore: boolean } = React.useContext(PlatformContext); const timeout_limit = resend_timeout || 60; let resend_interval: number; @@ -70,13 +67,9 @@ const SendEmailTemplate = ({ }; return ( -
+
- + {title} diff --git a/packages/components/src/components/static-url/static-url.tsx b/packages/components/src/components/static-url/static-url.tsx index 849f3ea72599..ebceaafc3f4e 100644 --- a/packages/components/src/components/static-url/static-url.tsx +++ b/packages/components/src/components/static-url/static-url.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { getStaticUrl, PlatformContext, setUrlLanguage } from '@deriv/shared'; +import { getStaticUrl, setUrlLanguage } from '@deriv/shared'; import { getLanguage } from '@deriv/translations'; type TStaticUrl = React.HTMLAttributes & { @@ -9,10 +9,9 @@ type TStaticUrl = React.HTMLAttributes & { }; const StaticUrl = ({ href, is_document, is_eu_url = false, children = null, ...props }: TStaticUrl) => { - const { is_appstore }: { is_appstore: boolean } = React.useContext(PlatformContext); const getHref = () => { setUrlLanguage(getLanguage()); - return getStaticUrl(href, { is_appstore }, is_document, is_eu_url); + return getStaticUrl(href, is_document, is_eu_url); }; return ( diff --git a/packages/components/stories/static-url/README.md b/packages/components/stories/static-url/README.md index 1255b49db742..0eac6558e90d 100644 --- a/packages/components/stories/static-url/README.md +++ b/packages/components/stories/static-url/README.md @@ -1,34 +1,34 @@ # StaticUrl component + Use this component to generate a link to 'deriv.com'. -We need 'PlatformContext' provider's value from the application state. #### Supported events: + All events supported for an '\' tag. ## Usage - + ```jsx import { StaticUrl } from 'deriv-components'; -const DummyComponent = (props) => ( - Static Url link. -); +const DummyComponent = props => Static Url link.; ``` ## Props -| Name | Type | Default | Description | -|--------------------------|------------------------|--------------------|--------------------------------------------------------------------------------------------------------------------------| -| href | {string} | null | Name of the static page on 'deriv.com' | -| is\_document | {boolean} | null | Set it to 'true' to get a normalized path for the link | - +| Name | Type | Default | Description | +| ----------- | --------- | ------- | ------------------------------------------------------ | +| href | {string} | null | Name of the static page on 'deriv.com' | +| is_document | {boolean} | null | Set it to 'true' to get a normalized path for the link | ## Full example: ```jsx import { SwipeableWrapper } from 'deriv-components'; -const DummyComponent = (props) => ( - Static Url link to a document. +const DummyComponent = props => ( + + Static Url link to a document. + ); ``` diff --git a/packages/components/stories/static-url/stories/basic.js b/packages/components/stories/static-url/stories/basic.js index 13a75fb2cad3..a04e1bf9acc4 100644 --- a/packages/components/stories/static-url/stories/basic.js +++ b/packages/components/stories/static-url/stories/basic.js @@ -1,17 +1,12 @@ import React from 'react'; -import { PlatformContext } from '@deriv/shared'; import { boolean } from '@storybook/addon-knobs'; import StaticUrl from 'Components/static-url'; import Wrapper from '../../shared/wrapper'; -const Provider = ({ children }) => {children}; - const Basic = () => ( - - - Link to the about page on deriv.com. - - + + Link to the about page on deriv.com. + ); export default Basic; diff --git a/packages/core/src/App/AppContent.tsx b/packages/core/src/App/AppContent.tsx index af9fafbd7145..03f16b7fe60b 100644 --- a/packages/core/src/App/AppContent.tsx +++ b/packages/core/src/App/AppContent.tsx @@ -18,7 +18,6 @@ import AppContents from './Containers/Layout/app-contents.jsx'; import Footer from './Containers/Layout/footer.jsx'; import Header from './Containers/Layout/header'; import AppModals from './Containers/Modals'; -import PlatformContainer from './Containers/PlatformContainer/PlatformContainer.jsx'; import Routes from './Containers/Routes/routes.jsx'; import Devtools from './Devtools'; import initDatadog from '../Utils/Datadog'; @@ -92,7 +91,7 @@ const AppContent: React.FC<{ passthrough: unknown }> = observer(({ passthrough } }, [has_wallet, store.common, store.ui]); return ( - + <>
@@ -110,7 +109,7 @@ const AppContent: React.FC<{ passthrough: unknown }> = observer(({ passthrough } {is_next_wallet_enabled && } - + ); }); diff --git a/packages/core/src/App/Components/Elements/NotificationMessage/notification.jsx b/packages/core/src/App/Components/Elements/NotificationMessage/notification.jsx index d8bf46a9b187..44c59037cfe7 100644 --- a/packages/core/src/App/Components/Elements/NotificationMessage/notification.jsx +++ b/packages/core/src/App/Components/Elements/NotificationMessage/notification.jsx @@ -2,7 +2,7 @@ import classNames from 'classnames'; import PropTypes from 'prop-types'; import React from 'react'; import { Button, LinearProgress, Text } from '@deriv/components'; -import { isEmptyObject, PlatformContext } from '@deriv/shared'; +import { isEmptyObject } from '@deriv/shared'; import CloseButton from './close-button.jsx'; import NotificationStatusIcons from './notification-status-icons.jsx'; import NotificationBanner from './notification-banner.jsx'; @@ -13,7 +13,6 @@ import NotificationOrder from './notification-order.jsx'; const Notification = ({ data, removeNotificationMessage }) => { const linear_progress_container_ref = React.useRef(null); - const { is_appstore } = React.useContext(PlatformContext); const destroy = is_closed_by_user => { removeNotificationMessage(data); @@ -138,7 +137,7 @@ const Notification = ({ data, removeNotificationMessage }) => { onClick={() => { if (data.timeout) linear_progress_container_ref.current.removeTimeoutSession(); - data.action.onClick({ is_appstore }); + data.action.onClick(); }} text={data.action.text} secondary diff --git a/packages/core/src/App/Components/Layout/Header/account-actions.jsx b/packages/core/src/App/Components/Layout/Header/account-actions.jsx index 8d6f2b4d35f8..2989a2cbbc4d 100644 --- a/packages/core/src/App/Components/Layout/Header/account-actions.jsx +++ b/packages/core/src/App/Components/Layout/Header/account-actions.jsx @@ -1,7 +1,7 @@ import * as PropTypes from 'prop-types'; import React from 'react'; import { Button, DesktopWrapper, Icon, MobileWrapper, Popover } from '@deriv/components'; -import { routes, formatMoney, PlatformContext, moduleLoader } from '@deriv/shared'; +import { routes, formatMoney, moduleLoader } from '@deriv/shared'; import { localize, Localize } from '@deriv/translations'; import { LoginButton } from './login-button.jsx'; import { SignupButton } from './signup-button.jsx'; @@ -37,8 +37,6 @@ const AccountActions = React.memo( toggleAccountsDialog, toggleNotifications, }) => { - const { is_appstore } = React.useContext(PlatformContext); - if (is_logged_in) { return ( @@ -128,7 +126,7 @@ const AccountActions = React.memo( return ( - + ); } diff --git a/packages/core/src/App/Components/Layout/Header/signup-button.jsx b/packages/core/src/App/Components/Layout/Header/signup-button.jsx index d4ca8d1a177f..a4249ff75ce7 100644 --- a/packages/core/src/App/Components/Layout/Header/signup-button.jsx +++ b/packages/core/src/App/Components/Layout/Header/signup-button.jsx @@ -4,20 +4,19 @@ import { Button } from '@deriv/components'; import { redirectToSignUp } from '@deriv/shared'; import { localize } from '@deriv/translations'; -const SignupButton = ({ className, is_appstore }) => ( +const SignupButton = ({ className }) => (
); diff --git a/packages/core/src/App/Containers/Redirect/redirect.jsx b/packages/core/src/App/Containers/Redirect/redirect.jsx index 94e4ed6f2fdf..d32e10499ca0 100644 --- a/packages/core/src/App/Containers/Redirect/redirect.jsx +++ b/packages/core/src/App/Containers/Redirect/redirect.jsx @@ -1,8 +1,7 @@ -import React from 'react'; import PropTypes from 'prop-types'; import { withRouter, useHistory } from 'react-router-dom'; import { useStoreWalletAccountsList } from '@deriv/hooks'; -import { loginUrl, routes, redirectToLogin, SessionStore, PlatformContext } from '@deriv/shared'; +import { loginUrl, routes, redirectToLogin, SessionStore } from '@deriv/shared'; import { observer, useStore } from '@deriv/stores'; import { getLanguage } from '@deriv/translations'; import { WS } from 'Services'; @@ -31,7 +30,6 @@ const Redirect = observer(() => { const action_param = url_params.get('action'); const code_param = url_params.get('code') || verification_code[action_param]; const ext_platform_url = url_params.get('ext_platform_url'); - const { is_appstore } = React.useContext(PlatformContext); const redirectToExternalPlatform = url => { history.push(`${routes.root}?ext_platform_url=${url}`); @@ -42,13 +40,11 @@ const Redirect = observer(() => { switch (action_param) { case 'signup': { - if (!is_appstore) { - Analytics.trackEvent('ce_virtual_signup_form', { - action: 'email_confirmed', - form_name: is_mobile ? 'virtual_signup_web_mobile_default' : 'virtual_signup_web_desktop_default', - email: url_params.get('email'), - }); - } + Analytics.trackEvent('ce_virtual_signup_form', { + action: 'email_confirmed', + form_name: is_mobile ? 'virtual_signup_web_mobile_default' : 'virtual_signup_web_desktop_default', + email: url_params.get('email'), + }); if (url_params?.get('utm_content')) { SessionStore.set('show_book', url_params?.get('utm_content')); } diff --git a/packages/hooks/src/__tests__/useStoreLinkedWalletsAccounts.spec.tsx b/packages/hooks/src/__tests__/useStoreLinkedWalletsAccounts.spec.tsx index 79b0332a78b3..44d2e72be71d 100644 --- a/packages/hooks/src/__tests__/useStoreLinkedWalletsAccounts.spec.tsx +++ b/packages/hooks/src/__tests__/useStoreLinkedWalletsAccounts.spec.tsx @@ -44,7 +44,6 @@ describe('useStoreLinkedWalletsAccounts', () => { ctrader: [], derivez: [{ loginid: 'CR777', platform: 'derivez' }], dtrade: [{ loginid: 'CR456', platform: 'dtrade' }], - dwallet: [], dxtrade: [], mt5: [{ loginid: 'CR123', platform: 'mt5' }], }); diff --git a/packages/hooks/src/useStoreLinkedWalletsAccounts.ts b/packages/hooks/src/useStoreLinkedWalletsAccounts.ts index 2b9fe2397c95..5c651367d80b 100644 --- a/packages/hooks/src/useStoreLinkedWalletsAccounts.ts +++ b/packages/hooks/src/useStoreLinkedWalletsAccounts.ts @@ -3,7 +3,7 @@ import useStoreWalletAccountsList from './useStoreWalletAccountsList'; type TLinkedAccount = { loginid?: string; - platform?: 'ctrader' | 'derivez' | 'dtrade' | 'dwallet' | 'dxtrade' | 'mt5'; + platform?: Exclude<'ctrader' | 'derivez' | 'dtrade' | 'dxtrade' | 'mt5', 'dwallet'>; }; type TReturnObjectType = { @@ -20,13 +20,12 @@ const useStoreLinkedWalletsAccounts = () => { ctrader: [], derivez: [], dtrade: [], - dwallet: [], dxtrade: [], mt5: [], }; wallets_list?.forEach(account => { - const linked = account.linked_to; + const linked = account.linked_to as TLinkedAccount[]; linked?.forEach(linked_to_account => { if (linked_to_account?.platform && linked_to_account?.loginid) diff --git a/packages/p2p/src/components/routes/__tests__/binary-routes.spec.tsx b/packages/p2p/src/components/routes/__tests__/binary-routes.spec.tsx index f3a94c4e7b14..aaf6ab5607bf 100644 --- a/packages/p2p/src/components/routes/__tests__/binary-routes.spec.tsx +++ b/packages/p2p/src/components/routes/__tests__/binary-routes.spec.tsx @@ -2,7 +2,6 @@ import React from 'react'; import { render, screen, waitFor } from '@testing-library/react'; import { createBrowserHistory } from 'history'; import { Router } from 'react-router-dom'; -import { PlatformContext } from '@deriv/shared'; import { mockStore, StoreProvider } from '@deriv/stores'; import BinaryRoutes from '../binary-routes'; @@ -22,12 +21,7 @@ const wrapper = ({ children }: { children: JSX.Element }) => { const history = createBrowserHistory(); - return render( - - {component} - , - { wrapper } - ); + return render({component}, { wrapper }); }; describe('', () => { diff --git a/packages/shared/src/utils/login/login.ts b/packages/shared/src/utils/login/login.ts index 9a256d9da1ad..ac4c4653c19c 100644 --- a/packages/shared/src/utils/login/login.ts +++ b/packages/shared/src/utils/login/login.ts @@ -16,13 +16,8 @@ export const redirectToLogin = (is_logged_in: boolean, language: string, has_par } }; -type TRedirectToSignUp = { - is_appstore?: boolean; - is_deriv_crypto?: boolean; -}; - -export const redirectToSignUp = ({ is_appstore }: TRedirectToSignUp = {}) => { - window.open(getStaticUrl('/signup/', { is_appstore })); +export const redirectToSignUp = () => { + window.open(getStaticUrl('/signup/')); }; type TLoginUrl = { diff --git a/packages/shared/src/utils/platform/index.ts b/packages/shared/src/utils/platform/index.ts index 3fd7443e7d0f..1841b995c932 100644 --- a/packages/shared/src/utils/platform/index.ts +++ b/packages/shared/src/utils/platform/index.ts @@ -1,2 +1 @@ export * from './platform'; -export * from './platform-context'; diff --git a/packages/shared/src/utils/platform/platform-context.tsx b/packages/shared/src/utils/platform/platform-context.tsx deleted file mode 100644 index d25518206662..000000000000 --- a/packages/shared/src/utils/platform/platform-context.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import React from 'react'; - -type TPlatformContext = { - is_appstore: boolean; - is_pre_appstore: boolean; - is_deriv_crypto: boolean; -}; - -export const PlatformContext = React.createContext({ - is_appstore: false, - is_pre_appstore: false, - is_deriv_crypto: false, -}); - -PlatformContext.displayName = 'DerivAppStorePlatformContext'; diff --git a/packages/shared/src/utils/url/url.ts b/packages/shared/src/utils/url/url.ts index dc32dfb41463..3850db6154fd 100644 --- a/packages/shared/src/utils/url/url.ts +++ b/packages/shared/src/utils/url/url.ts @@ -139,7 +139,7 @@ export const setUrlLanguage = (lang: string) => { /** * @deprecated Please use 'URLUtils.getDerivStaticURL' from '@deriv-com/utils' instead of this. */ -export const getStaticUrl = (path = '', _options = {}, is_document = false, is_eu_url = false) => { +export const getStaticUrl = (path = '', is_document = false, is_eu_url = false) => { const host = is_eu_url ? deriv_urls.DERIV_COM_PRODUCTION_EU : deriv_urls.DERIV_COM_PRODUCTION; let lang = default_language?.toLowerCase(); diff --git a/packages/stores/types.ts b/packages/stores/types.ts index 9fd3734cb104..934d29ace552 100644 --- a/packages/stores/types.ts +++ b/packages/stores/types.ts @@ -211,14 +211,7 @@ type TAccountsList = { mt5_login_list?: DetailsOfEachMT5Loginid[]; title?: string; }[]; -type TRealAccount = { - active_modal_index: number; - current_currency: string; - error_message: string; - previous_currency: string; - success_message: string; - error_code: number; -}; + // balance is missing in @deriv/api-types type TActiveAccount = TAccount & { balance?: string | number; @@ -339,16 +332,6 @@ export type TNotificationMessage = { timeoutMessage?: (remaining: number | string) => string; type: string; }; -type TCommonVariables = { - language: string; - visitorId?: string; - currency?: string; - userId?: string; - email?: string; - loggedIn: boolean; - theme: string; - platform: string; -}; type TNotification = | TNotificationMessage diff --git a/packages/trader/src/App/Components/Elements/Modals/ServicesErrorModal/__tests__/authorization-required-modal.spec.tsx b/packages/trader/src/App/Components/Elements/Modals/ServicesErrorModal/__tests__/authorization-required-modal.spec.tsx index 795173213716..d76e2543eb27 100644 --- a/packages/trader/src/App/Components/Elements/Modals/ServicesErrorModal/__tests__/authorization-required-modal.spec.tsx +++ b/packages/trader/src/App/Components/Elements/Modals/ServicesErrorModal/__tests__/authorization-required-modal.spec.tsx @@ -50,7 +50,6 @@ describe('', () => { is_visible: true, toggleModal: jest.fn(), is_logged_in: true, - is_appstore: true, }; it('modal title, modal description, log in button, and signup button to be rendered', () => { diff --git a/packages/trader/src/App/Components/Elements/Modals/ServicesErrorModal/authorization-required-modal.tsx b/packages/trader/src/App/Components/Elements/Modals/ServicesErrorModal/authorization-required-modal.tsx index 69779bab16ea..abda56e3a291 100644 --- a/packages/trader/src/App/Components/Elements/Modals/ServicesErrorModal/authorization-required-modal.tsx +++ b/packages/trader/src/App/Components/Elements/Modals/ServicesErrorModal/authorization-required-modal.tsx @@ -6,16 +6,10 @@ import { redirectToLogin, redirectToSignUp } from '@deriv/shared'; type TAuthorizationRequiredModal = { is_visible: boolean; toggleModal: () => void; - is_appstore?: boolean; is_logged_in: boolean; }; -const AuthorizationRequiredModal = ({ - is_visible, - toggleModal, - is_appstore, - is_logged_in, -}: TAuthorizationRequiredModal) => ( +const AuthorizationRequiredModal = ({ is_visible, toggleModal, is_logged_in }: TAuthorizationRequiredModal) => ( redirectToLogin(is_logged_in, getLanguage())} secondary /> -