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
Kta 60 results after uploading data #10
Merged
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
964543c
Adding Loading spinner component
sandoche d96e8f6
New result page created
sandoche 3921de9
Adding applicantId to the cookies
sandoche de58137
Adding redirection to result
sandoche 5ba7607
Implementing style box of result
sandoche 70f9e02
Loading block added
sandoche 37f3da5
Creating dummy endpoint
sandoche 6927c18
Improving types
sandoche 16d396f
Polling logic implemented
sandoche 9cf1099
Improve readability
sandoche 0c1bd4f
Handling the results
sandoche 50479d6
Removing test console.log
sandoche 8c4bf61
Implementing logic to display results
sandoche 38ad8b7
Success component implemented
sandoche 52f64d0
Changing text
sandoche e98e5df
Adding try again button
sandoche e90e078
Improving button style
sandoche 417f2e3
Handling long loadings
sandoche 27343a4
Code is handling all the type of errors
sandoche 9c01863
Refactoring button
sandoche ec5abc2
Renaming constant
sandoche e58f818
Adding user data in cookies
sandoche 09eee96
Adding data to localstorage instead of cookies
sandoche ce892df
Retry feature implemented, UX needs to be improved
sandoche be81221
Adding a comment to the code
sandoche 2e4e7cd
Improving error management
sandoche f4d72e7
Adding setting to remove refetch
sandoche f77e45b
Reorganizing components in folders
sandoche 2cbbe4f
Fixing renaming of components
sandoche dd15f99
Refactoring and creating a card component
sandoche 5622d4f
Refactoring the components for results
sandoche 6d0d0c6
Refactoring the loading component
sandoche 49526f9
Improve retry action
sandoche b0af28f
Fixing issue with bad importation
sandoche 3990e21
Fixing bad importation
sandoche 7fe73d3
Refactored the results success
sandoche ca89fda
Refactored the results failure page
sandoche 43d54ba
Refactoring the api calls
sandoche 5189393
Refactoring api calls and moving them to a service
sandoche 57a6198
Adding loading animation and disabled fields while sending
sandoche a100775
Improving style
sandoche b194efe
Fixing mobile responsive
sandoche 0d87e75
Improving style of landing page
sandoche 8fc0bcd
Updating first error page
sandoche c44fa7c
Updated design to have the full flow more consistent
sandoche 1415084
Changing failure text to make it more clear
sandoche 88a07da
Results error text improved
sandoche 0287365
Rephrasing the text
sandoche 2f4ed1d
Rewriting positive message
sandoche 9b5cec9
Reformatting values and adding comments for the constants
sandoche 203e88d
Adding better error handling, linting rule of no magic number, and fi…
sandoche ff92a74
Renaming e to event
sandoche ee5c509
Adding missing status for loading state
sandoche 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 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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh cool, I didn't know about this rule. 👍 I added to https://near-foundation.atlassian.net/jira/software/c/projects/ENG/boards/1?modal=detail&selectedIssue=ENG-156&quickFilter=1