Skip to content

Commit

Permalink
Maryia/fix: quick fix for failed & pending statuses (#19)
Browse files Browse the repository at this point in the history
* fix for pending statuses

* showing status when the card is selected

* quick fix for poi/poa failed statuses & footnotes
  • Loading branch information
maryia-deriv committed Jul 11, 2022
1 parent 5c4dca5 commit 07d4175
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 26 deletions.
48 changes: 27 additions & 21 deletions packages/cfd/src/Containers/jurisdiction-modal-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const JurisdictionCard = ({
</Text>
</div>
)}
{!poa_failed && !poi_failed && is_pending_authentication && type_of_card !== 'svg' && (
{!poa_failed && !poi_failed && is_pending_authentication && type_of_card && type_of_card !== 'svg' && (
<div className='cfd-jurisdiction-card__verification-status'>
<div className='cfd-jurisdiction-card__verification-status--pending'>
<Text size='xxxs' color={disabled ? 'less-prominent' : 'prominent'}>
Expand All @@ -140,7 +140,7 @@ const JurisdictionCard = ({
</Text>
</div>
)} */}
{poi_failed && type_of_card !== 'svg' && (
{poi_failed && !poa_failed && type_of_card && type_of_card !== 'svg' && (
<div className='cfd-jurisdiction-card__verification-status'>
<div className='cfd-jurisdiction-card__verification-status--POA_POI'>
<Text size='xxxs' color={disabled ? 'less-prominent' : 'white'}>
Expand All @@ -149,7 +149,7 @@ const JurisdictionCard = ({
</div>
</div>
)}
{poa_failed && type_of_card !== 'svg' && (
{poa_failed && !poi_failed && type_of_card && type_of_card !== 'svg' && (
<div className='cfd-jurisdiction-card__verification-status'>
<div className='cfd-jurisdiction-card__verification-status--POA_POI'>
<Text size='xxxs' color={disabled ? 'less-prominent' : 'white'}>
Expand All @@ -158,6 +158,15 @@ const JurisdictionCard = ({
</div>
</div>
)}
{poa_failed && poi_failed && type_of_card && type_of_card !== 'svg' && (
<div className='cfd-jurisdiction-card__verification-status'>
<div className='cfd-jurisdiction-card__verification-status--POA_POI'>
<Text size='xxxs' color={disabled ? 'less-prominent' : 'white'}>
<Localize i18n_default_text='Check your proof of identity and address' />
</Text>
</div>
</div>
)}
</>
);

Expand Down Expand Up @@ -258,22 +267,19 @@ const JurisdictionModalContent = ({
const ModalFootNote = () => {
return (
<>
{poa_none &&
poi_none &&
jurisdiction_selected_card !== 'svg' &&
jurisdiction_selected_card !== 'labuan' && (
<Text
as='p'
align='center'
size='xs'
weight='bold'
line_height='xs'
className='cfd-jurisdiction-card__footnote'
>
<Localize i18n_default_text='To create this account first we need your proof of identity and address.' />
</Text>
)}
{poi_failed && jurisdiction_selected_card !== 'svg' && (
{poa_none && poi_none && jurisdiction_selected_card !== 'svg' && jurisdiction_selected_card && (
<Text
as='p'
align='center'
size='xs'
weight='bold'
line_height='xs'
className='cfd-jurisdiction-card__footnote'
>
<Localize i18n_default_text='To create this account first we need your proof of identity and address.' />
</Text>
)}
{poi_failed && !poa_failed && jurisdiction_selected_card && jurisdiction_selected_card !== 'svg' && (
<Text
as='p'
align='center'
Expand All @@ -285,7 +291,7 @@ const JurisdictionModalContent = ({
<Localize i18n_default_text='To create this account first we need you to resubmit your proof of identity.' />
</Text>
)}
{poa_failed && jurisdiction_selected_card !== 'svg' && (
{poa_failed && !poi_failed && jurisdiction_selected_card && jurisdiction_selected_card !== 'svg' && (
<Text
as='p'
align='center'
Expand All @@ -297,7 +303,7 @@ const JurisdictionModalContent = ({
<Localize i18n_default_text='To create this account first we need you to resubmit your proof of address.' />
</Text>
)}
{poa_failed && poi_failed && jurisdiction_selected_card !== 'svg' && (
{poa_failed && poi_failed && jurisdiction_selected_card && jurisdiction_selected_card !== 'svg' && (
<Text
as='p'
align='center'
Expand Down
6 changes: 1 addition & 5 deletions packages/cfd/src/Containers/jurisdiction-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ const JurisdictionModal = ({
const poa_status = authentication_status?.document_status;
const poi_status = authentication_status?.identity_status;
const poi_poa_verified = poi_status === 'verified' && poa_status === 'verified';
const pending_conditions =
(poi_status === 'pending' && poa_status === 'pending') ||
(poi_status === 'pending' && poa_status === 'verified') ||
(poi_status === 'verified' && poa_status === 'pending');
const poi_failed = poi_status === 'suspected' || poi_status === 'rejected' || poi_status === 'expired';
const poa_failed = poa_status === 'suspected' || poa_status === 'rejected' || poa_status === 'expired';
const poi_poa_failed = poa_failed || poi_failed;
Expand All @@ -113,7 +109,7 @@ const JurisdictionModal = ({
(jurisdiction_selected_card &&
jurisdiction_selected_card !== 'svg' &&
(poi_poa_not_submitted || poi_poa_failed || (poi_poa_verified && checked)) &&
!pending_conditions);
!is_pending_authentication);

const onSelectRealAccount = () => {
const type_of_account = {
Expand Down

0 comments on commit 07d4175

Please sign in to comment.