-
Notifications
You must be signed in to change notification settings - Fork 13
[TASK-16296] Feat: Verification rework #1396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
bc8db70
feat: initial page
Zishan-7 631baf6
feat: update flow
Zishan-7 874185c
add already verified checks
Zishan-7 581bd3b
feat: add empty state
Zishan-7 265b535
feat: add accordion
Zishan-7 b3238d7
run formatter
Zishan-7 59f1934
Merge remote-tracking branch 'origin/peanut-wallet-dev' into fix/veri…
Zishan-7 821dc7d
fix: cr comments
Zishan-7 80243fc
fix: loading state on issuer country select
Zishan-7 70383be
feat: add KYC completed modal
Zishan-7 a12d51d
add missing dependency
Zishan-7 6f7eafe
Merge remote-tracking branch 'origin/peanut-wallet-dev' into fix/veri…
Zishan-7 b4f2259
Add js doc comments in `useIdentityVerification` hook
Zishan-7 82254b6
cr suggestions
Zishan-7 3d3f659
remove duplicate code
Zishan-7 2089f0e
feat: add mexico as unlocked region for bridge
Zishan-7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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
6 changes: 6 additions & 0 deletions
6
src/app/(mobile-ui)/profile/identity-verification/[region]/[country]/page.tsx
This file contains hidden or 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,6 @@ | ||
| 'use client' | ||
| import IdentityVerificationView from '@/components/Profile/views/IdentityVerification.view' | ||
|
|
||
| export default function IdentityVerificationCountryPage() { | ||
| return <IdentityVerificationView /> | ||
| } |
10 changes: 10 additions & 0 deletions
10
src/app/(mobile-ui)/profile/identity-verification/[region]/page.tsx
This file contains hidden or 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,10 @@ | ||
| 'use client' | ||
| import RegionsPage from '@/components/Profile/views/RegionsPage.view' | ||
| import { useParams } from 'next/navigation' | ||
|
|
||
| export default function IdentityVerificationRegionPage() { | ||
| const params = useParams() | ||
| const region = params.region as string | ||
|
|
||
| return <RegionsPage path={region} /> | ||
| } |
59 changes: 59 additions & 0 deletions
59
src/app/(mobile-ui)/profile/identity-verification/layout.tsx
This file contains hidden or 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,59 @@ | ||
| 'use client' | ||
|
|
||
| import PageContainer from '@/components/0_Bruddle/PageContainer' | ||
| import ActionModal from '@/components/Global/ActionModal' | ||
| import { useIdentityVerification } from '@/hooks/useIdentityVerification' | ||
| import { useParams, useRouter } from 'next/navigation' | ||
| import { useEffect, useState } from 'react' | ||
|
|
||
| export default function IdentityVerificationLayout({ children }: { children: React.ReactNode }) { | ||
| const [isAlreadyVerifiedModalOpen, setIsAlreadyVerifiedModalOpen] = useState(false) | ||
| const router = useRouter() | ||
| const { isRegionAlreadyUnlocked, isVerifiedForCountry } = useIdentityVerification() | ||
| const params = useParams() | ||
| const regionParams = params.region as string | ||
| const countryParams = params.country as string | ||
|
|
||
| useEffect(() => { | ||
| const isAlreadyVerified = | ||
| (countryParams && isVerifiedForCountry(countryParams)) || | ||
| (regionParams && isRegionAlreadyUnlocked(regionParams)) | ||
|
|
||
| if (isAlreadyVerified) { | ||
| setIsAlreadyVerifiedModalOpen(true) | ||
| } | ||
| }, [countryParams, regionParams, isVerifiedForCountry, isRegionAlreadyUnlocked]) | ||
|
|
||
| return ( | ||
| <PageContainer> | ||
| {children} | ||
|
|
||
| <ActionModal | ||
| visible={isAlreadyVerifiedModalOpen} | ||
| onClose={() => { | ||
| setIsAlreadyVerifiedModalOpen(false) | ||
| router.push('/profile') | ||
| }} | ||
| title="You're already verified" | ||
| description={ | ||
| <p> | ||
| Your identity has already been successfully verified for this region. You can continue to use | ||
| features available in this region. No further action is needed. | ||
| </p> | ||
| } | ||
| icon="shield" | ||
| ctas={[ | ||
| { | ||
| text: 'Close', | ||
| shadowSize: '4', | ||
| className: 'md:py-2', | ||
| onClick: () => { | ||
| setIsAlreadyVerifiedModalOpen(false) | ||
| router.push('/profile') | ||
| }, | ||
| }, | ||
| ]} | ||
| /> | ||
| </PageContainer> | ||
| ) | ||
| } |
This file contains hidden or 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,10 +1,5 @@ | ||
| import PageContainer from '@/components/0_Bruddle/PageContainer' | ||
| import IdentityVerificationView from '@/components/Profile/views/IdentityVerification.view' | ||
| import RegionsVerification from '@/components/Profile/views/RegionsVerification.view' | ||
|
|
||
| export default function IdentityVerificationPage() { | ||
| return ( | ||
| <PageContainer> | ||
| <IdentityVerificationView /> | ||
| </PageContainer> | ||
| ) | ||
| return <RegionsVerification /> | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.