-
Please upload one of the following documents:
- {documentTypes.map(({ countries, description, icon, title, value }) => {
- if (countries && !countries.includes(data?.country_code ?? '')) {
- return null;
- }
- return (
-
- );
- })}
+
+ Please upload one of the following documents:
+ {documentTypes.map(({ countries, description, icon, title, value }) => {
+ if (countries && !countries.includes(data?.country_code ?? '')) {
+ return null;
+ }
+ return (
+
+ );
+ })}
+
);
};
diff --git a/packages/wallets/src/features/accounts/screens/ManualDocumentUpload/constants.tsx b/packages/wallets/src/features/accounts/screens/ManualDocumentUpload/constants.tsx
index c68c684ebb9e..a8f92896b74d 100644
--- a/packages/wallets/src/features/accounts/screens/ManualDocumentUpload/constants.tsx
+++ b/packages/wallets/src/features/accounts/screens/ManualDocumentUpload/constants.tsx
@@ -23,7 +23,7 @@ export const documentTypes: TDocumentType[] = [
description: 'Upload the front and back of your driving licence.',
icon: DrivingLicenseIcon,
title: 'Driving licence',
- value: 'driver-license',
+ value: 'driving-license',
},
{
description: 'Upload the front and back of your identity card.',
diff --git a/packages/wallets/src/features/cfd/flows/Verification/Verification.tsx b/packages/wallets/src/features/cfd/flows/Verification/Verification.tsx
index 9d02d25d562c..687908167cc1 100644
--- a/packages/wallets/src/features/cfd/flows/Verification/Verification.tsx
+++ b/packages/wallets/src/features/cfd/flows/Verification/Verification.tsx
@@ -1,31 +1,17 @@
import React, { FC, useMemo } from 'react';
import * as Yup from 'yup';
-import { useAuthentication, usePOA, usePOI } from '@deriv/api';
+import { useAuthentication, usePOA, usePOI, useSettings } from '@deriv/api';
import { ModalStepWrapper, WalletButton } from '../../../../components/Base';
import { FlowProvider, TFlowProviderContext } from '../../../../components/FlowProvider';
import { Loader } from '../../../../components/Loader';
import { useModal } from '../../../../components/ModalProvider';
import { THooks } from '../../../../types';
-import { ResubmitPOA } from '../../../accounts/screens';
+import { ManualDocumentUpload, ResubmitPOA } from '../../../accounts/screens';
import { IDVDocumentUpload } from '../../../accounts/screens/IDVDocumentUpload';
+import { PersonalDetails } from '../../../accounts/screens/PersonalDetails';
+import { MT5PasswordModal } from '../../modals';
import { Onfido } from '../../screens';
-const Manual = () => {
- return (
-
@@ -34,17 +20,12 @@ const Loading = () => {
);
};
-const Password = () => {
- return
Password screen
;
-};
-
// TODO: Replace these mock components with the screens
const screens = {
idvScreen:
,
loadingScreen:
,
- manualScreen:
,
+ manualScreen:
,
onfidoScreen:
,
- passwordScreen:
,
personalDetailsScreen:
,
poaScreen:
,
};
@@ -57,41 +38,44 @@ const Verification: FC
= ({ selectedJurisdiction }) => {
const { data: poiStatus, isSuccess: isSuccessPOIStatus } = usePOI();
const { data: poaStatus, isSuccess: isSuccessPOAStatus } = usePOA();
const { data: authenticationData } = useAuthentication();
- const { hide } = useModal();
+ const { data: getSettings } = useSettings();
+ const { getModalState, hide, show } = useModal();
+
+ const selectedMarketType = getModalState('marketType') || 'all';
+ const platform = getModalState('platform') || 'mt5';
const isLoading = useMemo(() => {
return !isSuccessPOIStatus || !isSuccessPOAStatus;
}, [isSuccessPOIStatus, isSuccessPOAStatus]);
const hasAttemptedPOA = poaStatus?.has_attempted_poa || true;
- const needPersonalDetails = true;
const initialScreenId: keyof typeof screens = useMemo(() => {
const service = (poiStatus?.current?.service || 'manual') as keyof THooks.POI['services'];
- if (poiStatus?.services) {
- const serviceStatus = poiStatus.services?.[service];
+ if (poiStatus?.services && isSuccessPOIStatus) {
+ const serviceStatus = poiStatus.current.status;
if (!isSuccessPOIStatus) return 'loadingScreen';
+
if (serviceStatus === 'pending' || serviceStatus === 'verified') {
if (authenticationData?.is_poa_needed && !hasAttemptedPOA) return 'poaScreen';
- if (needPersonalDetails) return 'personalDetailsScreen';
- return 'passwordScreen';
+ if (!getSettings?.has_submitted_personal_details) return 'personalDetailsScreen';
+ show();
}
if (service === 'idv') return 'idvScreen';
if (service === 'onfido') return 'onfidoScreen';
- return 'manualScreen';
}
return 'loadingScreen';
- // eslint-disable-next-line react-hooks/exhaustive-deps
}, [
- hasAttemptedPOA,
- needPersonalDetails,
- authenticationData?.is_poa_needed,
poiStatus,
- poiStatus?.services,
- poiStatus?.current?.service,
isSuccessPOIStatus,
+ authenticationData?.is_poa_needed,
+ hasAttemptedPOA,
+ getSettings?.has_submitted_personal_details,
+ show,
+ selectedMarketType,
+ platform,
]);
const isNextDisabled = ({ currentScreenId, formValues }: TFlowProviderContext) => {
@@ -112,17 +96,17 @@ const Verification: FC = ({ selectedJurisdiction }) => {
if (['idvScreen', 'onfidoScreen', 'manualScreen'].includes(currentScreenId)) {
if (hasAttemptedPOA) {
switchScreen('poaScreen');
- } else if (needPersonalDetails) {
+ } else if (!getSettings?.has_submitted_personal_details) {
switchScreen('personalDetailsScreen');
} else {
- switchScreen('passwordScreen');
+ show();
}
} else if (currentScreenId === 'poaScreen') {
- if (needPersonalDetails) {
+ if (!getSettings?.has_submitted_personal_details) {
switchScreen('personalDetailsScreen');
}
} else if (currentScreenId === 'personalDetailsScreen') {
- switchScreen('passwordScreen');
+ show();
} else {
hide();
}
@@ -134,6 +118,7 @@ const Verification: FC = ({ selectedJurisdiction }) => {
documentNumber: Yup.string().min(12, 'document number should have minimum 12 characters').required(),
firstName: Yup.string().min(1).max(5).required(),
lastName: Yup.string().min(1).max(20).required(),
+ townCityLine: Yup.string().min(5).max(20).required(),
});
return (
diff --git a/packages/wallets/src/features/cfd/modals/JurisdictionModal/JurisdictionModal.tsx b/packages/wallets/src/features/cfd/modals/JurisdictionModal/JurisdictionModal.tsx
index 7ce38451cbb6..0229e196d7aa 100644
--- a/packages/wallets/src/features/cfd/modals/JurisdictionModal/JurisdictionModal.tsx
+++ b/packages/wallets/src/features/cfd/modals/JurisdictionModal/JurisdictionModal.tsx
@@ -5,6 +5,7 @@ import { useModal } from '../../../../components/ModalProvider';
import useDevice from '../../../../hooks/useDevice';
import { DynamicLeverageContext } from '../../components/DynamicLeverageContext';
import { MarketTypeDetails } from '../../constants';
+import { Verification } from '../../flows/Verification';
import { DynamicLeverageScreen, DynamicLeverageTitle } from '../../screens/DynamicLeverage';
import { JurisdictionScreen } from '../../screens/Jurisdiction';
import { MT5PasswordModal } from '..';
@@ -30,13 +31,21 @@ const JurisdictionModal = () => {
const jurisdictionTitle = `Choose a jurisdiction for your Deriv MT5 ${title} account`;
+ const JurisdictionFlow = () => {
+ if (selectedJurisdiction === 'svg') {
+ return ;
+ }
+
+ return ;
+ };
+
const modalFooter = isDynamicLeverageVisible
? undefined
: () => (
show()}
+ onClick={() => show()}
text='Next'
/>
);