Skip to content

Commit

Permalink
Merge pull request #29 from amina-deriv/shaheer/code-duplication-fix
Browse files Browse the repository at this point in the history
Shaheer/code duplication fix
  • Loading branch information
shaheer-deriv authored May 22, 2023
2 parents 2c4996f + c7eb7c4 commit dc915c7
Show file tree
Hide file tree
Showing 70 changed files with 3,157 additions and 889 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ describe('<CurrencySelector/>', () => {
is_virtual: 1,
landing_company_shortcode: 'virtual',
trading: {},
token: 'a1-sLGGrhfYPkeEprxEop2T591cLKbuN',
email: 'test+qw@deriv.com',
token: '',
email: '',
session_start: 1651059038,
excluded_until: '',
landing_company_name: 'virtual',
Expand Down Expand Up @@ -273,8 +273,8 @@ describe('<CurrencySelector/>', () => {
is_virtual: 1,
landing_company_shortcode: 'svg',
trading: {},
token: 'a1-sLGGrhfYPkeEprxEop2T591cLKbuN',
email: 'test+qw@deriv.com',
token: '',
email: '',
session_start: 1651059038,
excluded_until: '',
landing_company_name: 'svg',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Button, Icon, Loading } from '@deriv/components';
import { localize } from '@deriv/translations';
import { getAuthenticationStatusInfo } from '@deriv/shared';
import { getAuthenticationStatusInfo, Jurisdiction } from '@deriv/shared';
import IconMessageContent from 'Components/icon-message-content';
import { GetAccountStatus } from '@deriv/api-types';

Expand Down Expand Up @@ -43,8 +43,9 @@ const PoiPoaDocsSubmitted = ({
const getDescription = () => {
const { manual_status, poi_verified_for_vanuatu_maltainvest, poi_verified_for_bvi_labuan, poa_pending } =
getAuthenticationStatusInfo(account_status);
const is_vanuatu_or_maltainvest_selected =
jurisdiction_selected_shortcode === 'vanuatu' || jurisdiction_selected_shortcode === 'maltainvest';
const is_vanuatu_or_maltainvest_selected = [Jurisdiction.VANUATU, Jurisdiction.MALTA_INVEST].includes(
jurisdiction_selected_shortcode
);
if (
(is_vanuatu_or_maltainvest_selected && poi_verified_for_vanuatu_maltainvest && poa_pending) ||
(!is_vanuatu_or_maltainvest_selected && poi_verified_for_bvi_labuan && poa_pending) ||
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react-hooks/exhaustive-deps */
import React from 'react';
import { WS } from '@deriv/shared';
import { WS, Jurisdiction } from '@deriv/shared';
import Unsupported from 'Components/poi/status/unsupported';
import OnfidoUpload from './onfido-sdk-view.jsx';
import { identity_status_codes, submission_status_code, service_code } from './proof-of-identity-utils';
Expand Down Expand Up @@ -30,7 +30,7 @@ const POISubmissionForMT5 = ({
is_idv_supported &&
Number(idv_submissions_left) > 0 &&
!is_idv_disallowed &&
jurisdiction_selected_shortcode !== 'vanuatu'
jurisdiction_selected_shortcode !== Jurisdiction.VANUATU
) {
setSubmissionService(service_code.idv);
} else if (onfido_submissions_left && is_onfido_supported) {
Expand Down
Loading

0 comments on commit dc915c7

Please sign in to comment.