forked from deriv-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WALL] Farhan/WALL-2599/Identity Card Document Submission (deriv-com#…
…11446) * feat: create identity card upload screen * refactor: 🔧 refactor divider component * refactor: 🔧 remove styles props in dropzone component
- Loading branch information
1 parent
fbc5d1a
commit d25dc13
Showing
17 changed files
with
272 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
.wallets-divider { | ||
&__horizontal { | ||
width: 100%; | ||
|
||
&--horizontal { | ||
border-top: 1px solid; | ||
} | ||
|
||
&__vertical { | ||
&--vertical { | ||
border-right: 1px solid; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...nts/DocumentRuleHint/DocumentRuleHint.tsx → ...nts/DocumentRuleHint/DocumentRuleHint.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
12 changes: 12 additions & 0 deletions
12
...accounts/screens/ManualDocumentUpload/components/DocumentRuleHints/DocumentRuleHints.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.wallets-document-rule-hints { | ||
display: flex; | ||
justify-content: center; | ||
width: 100%; | ||
|
||
@include mobile { | ||
display: grid; | ||
grid-template-columns: repeat(2, 1fr); | ||
column-gap: 2.4rem; | ||
row-gap: 0.8rem; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
.../accounts/screens/ManualDocumentUpload/components/DocumentRuleHints/DocumentRuleHints.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react'; | ||
import ClearPhoto from '../../../../../../public/images/accounts/clear-photo.svg'; | ||
import ClockIcon from '../../../../../../public/images/accounts/clock-icon.svg'; | ||
import ImageIcon from '../../../../../../public/images/accounts/image-icon.svg'; | ||
import LessThanEightIcon from '../../../../../../public/images/accounts/less-than-eight-icon.svg'; | ||
import { DocumentRuleHint } from './DocumentRuleHint'; | ||
import './DocumentRuleHints.scss'; | ||
|
||
type TProps = { | ||
docType: 'driverLicense' | 'identityCard' | 'nimcSlip' | 'passport'; | ||
}; | ||
|
||
const DocumentRuleHints: React.FC<TProps> = ({ docType }) => ( | ||
<div className='wallets-document-rule-hints'> | ||
<DocumentRuleHint description='A clear colour photo or scanned image' icon={<ClearPhoto />} /> | ||
<DocumentRuleHint description='JPEG, JPG, PNG, PDF, or GIF' icon={<ImageIcon />} /> | ||
<DocumentRuleHint description='Less than 8MB' icon={<LessThanEightIcon />} /> | ||
{docType !== 'nimcSlip' && ( | ||
<DocumentRuleHint description='Must be valid for at least 6 months' icon={<ClockIcon />} /> | ||
)} | ||
</div> | ||
); | ||
|
||
export default DocumentRuleHints; |
1 change: 1 addition & 0 deletions
1
.../src/features/accounts/screens/ManualDocumentUpload/components/DocumentRuleHints/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as DocumentRuleHints } from './DocumentRuleHints'; |
86 changes: 86 additions & 0 deletions
86
...anualDocumentUpload/components/IdentityCardDocumentUpload/IdentityCardDocumentUpload.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
.wallets-identity-card-document-upload { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 2.4rem; | ||
padding: 2.4rem; | ||
width: fit-content; | ||
background: var(--light-8-primary-background, #fff); | ||
|
||
@include mobile { | ||
width: 100%; | ||
} | ||
|
||
&__document-section { | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 1.7rem; | ||
|
||
@include mobile { | ||
gap: 1.6rem; | ||
} | ||
} | ||
|
||
&__dropzones { | ||
width: 100%; | ||
display: flex; | ||
align-items: flex-start; | ||
gap: 2.4rem; | ||
|
||
@include mobile { | ||
flex-direction: column; | ||
} | ||
|
||
&--left { | ||
width: 100%; | ||
|
||
& > .wallets-dropzone__container { | ||
min-width: 33.5rem; | ||
} | ||
|
||
& > .wallets-dropzone { | ||
padding: 4rem 4.7rem 4rem 3.9rem; | ||
} | ||
} | ||
|
||
&--right { | ||
width: 100%; | ||
|
||
& > .wallets-dropzone__container { | ||
min-width: 31rem; | ||
} | ||
|
||
& > .wallets-dropzone { | ||
padding: 4rem 2.4rem; | ||
} | ||
} | ||
|
||
& .wallets-dropzone__container { | ||
height: 25rem; | ||
|
||
@include mobile { | ||
min-width: 100%; | ||
} | ||
} | ||
|
||
& .wallets-dropzone { | ||
@include mobile { | ||
padding: 2rem; | ||
} | ||
} | ||
} | ||
|
||
&__input-group { | ||
display: flex; | ||
gap: 2.4rem; | ||
padding-bottom: 2rem; | ||
width: 100%; | ||
|
||
@include mobile { | ||
flex-direction: column; | ||
gap: 1.6rem; | ||
} | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
...ManualDocumentUpload/components/IdentityCardDocumentUpload/IdentityCardDocumentUpload.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React from 'react'; | ||
import { Divider, Dropzone, WalletText, WalletTextField } from '../../../../../../components'; | ||
import IdentityCardBack from '../../../../../../public/images/accounts/document-back.svg'; | ||
import IdentityCardFront from '../../../../../../public/images/accounts/identity-card-front.svg'; | ||
import Calendar from '../../../../../../public/images/calendar.svg'; | ||
import { DocumentRuleHints } from '../DocumentRuleHints'; | ||
import './IdentityCardDocumentUpload.scss'; | ||
|
||
const IdentityCardDocumentUpload = () => { | ||
return ( | ||
<div className='wallets-identity-card-document-upload' data-testid='dt_passport-document-upload'> | ||
<WalletText>First, enter your Identity card number and the expiry date.</WalletText> | ||
<div className='wallets-identity-card-document-upload__input-group'> | ||
<WalletTextField label='Identity card number*' maxWidth='100%' /> | ||
<WalletTextField | ||
label='Expiry date*' | ||
maxWidth='100%' | ||
renderRightIcon={() => <Calendar />} | ||
type='date' | ||
/> | ||
</div> | ||
<Divider /> | ||
<div className='wallets-identity-card-document-upload__document-section'> | ||
<WalletText>Next, upload the front and back of your identity card.</WalletText> | ||
<div className='wallets-identity-card-document-upload__dropzones'> | ||
<div className='wallets-identity-card-document-upload__dropzones--left'> | ||
<Dropzone | ||
buttonText='Drop file or click here to upload' | ||
description='Upload the front of your identity card.' | ||
fileFormats={['image/jpeg', 'image/jpg', 'image/png', 'image/gif', 'application/pdf']} | ||
icon={<IdentityCardFront />} | ||
maxSize={8388608} | ||
/> | ||
</div> | ||
<div className='wallets-identity-card-document-upload__dropzones--right'> | ||
<Dropzone | ||
buttonText='Drop file or click here to upload' | ||
description='Upload the back of your identity card.' | ||
fileFormats={['image/jpeg', 'image/jpg', 'image/png', 'image/gif', 'application/pdf']} | ||
icon={<IdentityCardBack />} | ||
maxSize={8388608} | ||
/> | ||
</div> | ||
</div> | ||
<DocumentRuleHints docType='identityCard' /> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default IdentityCardDocumentUpload; |
1 change: 1 addition & 0 deletions
1
...ures/accounts/screens/ManualDocumentUpload/components/IdentityCardDocumentUpload/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as IdentityCardDocumentUpload } from './IdentityCardDocumentUpload'; |
Oops, something went wrong.