This repository was archived by the owner on Jul 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from NEARFoundation/KTA-60-results-after-uploa…
…ding-data Kta 60 results after uploading data
- Loading branch information
Showing
32 changed files
with
466 additions
and
124 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
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
.card { | ||
width: 94vw; | ||
max-width: 32em; | ||
border-color: rgb(130, 136, 147); | ||
border-width: 1px; | ||
border-style: solid; | ||
padding: 32px; | ||
border-radius: 8px; | ||
margin: auto; | ||
margin-top: 32px; | ||
text-align: center; | ||
min-height: 37.5em; | ||
background-color: #fcfcfd; | ||
|
||
@media (max-width: 478px) { | ||
border: none; | ||
background-color: #fff; | ||
} | ||
} |
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,5 @@ | ||
import styles from './CenteredCard.module.scss'; | ||
|
||
export default function CenteredCard({ children }: { children: React.ReactNode }): JSX.Element { | ||
return <div className={styles.card}>{children}</div>; | ||
} |
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,9 @@ | ||
.contentCentered { | ||
min-height: 37.5em; | ||
height: 100%; | ||
width: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
flex-direction: column; | ||
} |
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,28 @@ | ||
/* eslint-disable react/require-default-props */ | ||
import LoadingSpinner from './LoadingSpinner'; | ||
|
||
import styles from './CenteredCardContent.module.css'; | ||
|
||
export default function CenteredCardContent({ | ||
title, | ||
description, | ||
iconClasses, | ||
isLoading = false, | ||
children = null, | ||
}: { | ||
title: string; | ||
description: string | JSX.Element; | ||
iconClasses: string; | ||
isLoading?: boolean; | ||
children?: React.ReactNode; | ||
}): JSX.Element { | ||
return ( | ||
<div className={styles.contentCentered}> | ||
{isLoading && <LoadingSpinner />} | ||
<i className={iconClasses} style={{ fontSize: '98px' }} aria-hidden="true" /> | ||
<h1 className="fs-2 mb-2">{title}</h1> | ||
<p className="text-secondary mb-4">{description}</p> | ||
{children} | ||
</div> | ||
); | ||
} |
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,7 @@ | ||
export default function LoadingSpinner(): JSX.Element { | ||
return ( | ||
<div className="spinner-border" role="status"> | ||
<span className="sr-only">Loading...</span> | ||
</div> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import type { SdkHandle } from 'onfido-sdk-ui'; | ||
|
||
import CenteredCard from '../common/CenteredCard'; | ||
import Header from '../layout/Header'; | ||
|
||
import ApplicantForm from './ApplicantForm'; | ||
|
||
function FirstStep({ onfidoInstance, onSubmit, loading }: { onfidoInstance: SdkHandle | null; onSubmit: (event: React.SyntheticEvent) => void; loading: boolean }): JSX.Element { | ||
return onfidoInstance ? ( | ||
<div /> | ||
) : ( | ||
<CenteredCard> | ||
<Header /> | ||
<h3 className="mb-4">We want to get to know you!</h3> | ||
<p>Start by introducing yourself here.</p> | ||
<p>On the next page, we'll ask you to provide other information (documents or photos) that will help verify your identity.</p> | ||
|
||
<ApplicantForm onSubmit={onSubmit} loading={loading} /> | ||
</CenteredCard> | ||
); | ||
} | ||
|
||
export default FirstStep; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import CenteredCardContent from '../common/CenteredCardContent'; | ||
|
||
import ResultsRetryButton from './ResultsRetryButton'; | ||
|
||
export default function ResultsFailure(): JSX.Element { | ||
return ( | ||
<CenteredCardContent title="An error occured" description="Sorry, an error occurred; we invite you to try again." iconClasses="fa fa-exclamation-circle text-warning mb-4"> | ||
<ResultsRetryButton /> | ||
</CenteredCardContent> | ||
); | ||
} |
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,15 @@ | ||
import CenteredCardContent from '../common/CenteredCardContent'; | ||
|
||
import ResultsRetryButton from './ResultsRetryButton'; | ||
|
||
export default function ResultsFailure(): JSX.Element { | ||
return ( | ||
<CenteredCardContent | ||
title="Verification failed" | ||
description="We could not verify your identity. If you believe that you submitted any information incorrectly, you may try again." | ||
iconClasses="fa fa-times-circle text-danger mb-4" | ||
> | ||
<ResultsRetryButton /> | ||
</CenteredCardContent> | ||
); | ||
} |
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,22 @@ | ||
import CenteredCardContent from '../common/CenteredCardContent'; | ||
|
||
export default function ResultsLoading({ willTakeLonger }: { willTakeLonger: boolean }): JSX.Element { | ||
return ( | ||
<CenteredCardContent | ||
title="" | ||
iconClasses="" | ||
isLoading | ||
description={ | ||
willTakeLonger ? ( | ||
<p> | ||
<strong>This identity verification is taking more time than usual.</strong> | ||
<br /> | ||
Feel free to close this page and come back later to {window.location.href} | ||
</p> | ||
) : ( | ||
'Please wait...' | ||
) | ||
} | ||
/> | ||
); | ||
} |
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 @@ | ||
import Link from 'next/link'; | ||
|
||
export default function ResultsRetryButton(): JSX.Element { | ||
return ( | ||
<Link href={`/${process.env.NEXT_PUBLIC_KYC_ENDPOINT_KEY}?retry=1`} passHref> | ||
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */} | ||
<a className="btn btn-primary"> | ||
Try again <i className="fa fa-repeat" aria-hidden="true" /> | ||
</a> | ||
</Link> | ||
); | ||
} |
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,11 @@ | ||
import CenteredCardContent from '../common/CenteredCardContent'; | ||
|
||
export default function ResultsSuccess(): JSX.Element { | ||
return ( | ||
<CenteredCardContent | ||
title="Verification validated" | ||
description="Congratulations! 🎉 We have verified your identity and are excited to move forward. NEAR Foundation will contact you for the next steps shortly. You can now close this window." | ||
iconClasses="fa fa-check-circle text-success mb-4" | ||
/> | ||
); | ||
} |
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,5 @@ | ||
export const COOKIES_EXPIRATION_TIME = 2592000; // 30 days | ||
export const COOKIE_CHECK_ID_NAME = 'onfido-check-id'; | ||
export const LOCALSTORAGE_USER_DATA_NAME = 'onfido-user-data'; | ||
export const SHORT_POLLING_INTERVAL = 1000; // 1 second - Short polling applies when the check is in progress | ||
export const LONG_POLLING_INTERVAL = 30_000; // 30 seconds - Long polling applies when the check is under manual approval |
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
Oops, something went wrong.