forked from binary-com/deriv-app
-
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.
Likhith/kyc 363/onfido sdk updation (binary-com#10560)
* refactor: review comments * refactor: review comments css * fix: 🐛 incorporated message to display document type * fix: resolved code smell * fix: 🐛 incorporated generic error message * fix: 🐛 added missing dependency * chore: 🔀 synced with master * fix: ♻️ incorporated review comments * fix: resolved un necessary render issue * fix: 🐛 resolved issue with expired status * style: fix side container width in poi (#39) * style: container height fix for POI error messages when content in not overflowing (#40) * fix: onfido message alignment * fix: 🐛 incorporated continue trade button * fix: onfido page mobile * style: no padding on fields container in idv screen (#41) * refactor: onfido hint center alignment fix * fix: odd translate value fix * fix: 🐛 minor CSS fix * fix: green message responsive position * fix: green message full width * fix: ✅ updated testcases * fix: failing tests * refactor: code and ts fixes * fix: display of IDV error * chore: add duplication account error * refactor: added undefined check to response data * chore: review comments * chore: review comments * fix: ⬆️ upgraded SDK and handled language change * fix: ♻️ incorporated review comments * fix: ♻️ refactored code to remove useRef * fix: barriers test fix form master * fix: barriers test * chore: refactored object.freeze to as const * chore: optional chaining to document type * chore: update spec file for idv-form * test: update personal-details spec * chore: review comments * refactor: ♻️ incorporated hooks to handle business logic * refactor: css structure * fix: barriers test * fix: ⚰️ removed unwanted code * test: 🔥 removed mocked tokens * chore: 📝 Added documentation for UseNotificationEvent hook * fix: 💄 incorporated styling * fix: ♻️ incorporated review comments * refactor: rename properties * refactor: remove is_appstore from tests * fix: ♻️ incorporated review comments * refactor: styles refactor * fix: ⚡ reduced duplicate data * fix: incorporated review comments * fix: ♻️ incorporated review comments * chore: Trigger Build * fix: 🚚 modified path * chore: remove unused fila and variable, updated icons * revert: 🍻 removed icon changes * refactor: removed formatting * fix: removed assignment of default values * fix: 🐛 unable to select a new doc supporting country * fix: 🐛 resolved re-render issue * fix: ⚡ resolved message issue * refactor: 🚚 renamed varibales * fix: 🧪 failing testcase * fix: 🐛 resolved issues with failure messages * fix: 🐛 resolved issue with DIEL accounts * fix: 🐛 fixed issue for DIEL clients * fix: styling issues * fix: ts error for format-response * build: 📌 updated package-lock after updating onfido-sdk-ui * fix: 🚚 fixed path * fix: 🚚 fixed path * fix: 🐛 resolved styling bugs * fix: 🐛 resolved styling bugs * fix: ♻️ removed default values * fix: 🔥 incorporated new styles to fix icon size * fix: 🔥 incorporated new styles to fix icon size * fix: ✅ fixed failing testcase * fix: 💚 eslint issues * fix: ⚡ incorporated platform language change * fix: removed store * fix: layout styles * fix: style issues * fix: styles * fix: moved common styles to core * refactor: incorporated review comments * fix: 💄 updated styles * fix: 🐛 reverted code * fix: 🐛 reverted code * refactor: incorporated review comments * fix: 🐛 Onfido SDK language code conversion * fix: migrated hooks * revert: logic for generating code * chore: adding missing testcases * fix: recatored Onfido constants * fix: onfido screen css issues * fix: removed package-lock to resolve merge error * Merge branch 'master' into likhith/KYC-363/onfido-sdk-updation * chore: added package-lock * Merge branch 'master' into combined/wall-400/IDV-error-message-handled * chore: Trigger Build * fix: bug: /WEBREL-1358/personal-details page and poa page css issue * fix: layout button * fix: layout button * fix: mt5 next button not getting enabled * fix: resolved issue with button * fix: resolved issue with button * fix: resolved missing dropdown * fix: removed console * fix: incorporated review comments * feat: ✨ incorporated new images and merged checkbox feature * feat: ✨ incorporated new images and merged checkbox feature * fix: idv failed document type * fix: removed duplicate import * fix: incorporated error message scenario * fix: styling as per new figma * fix: styling as per new figma * fix: spacing between fields * fix: spacing between fields * fix: spacing between fields * fix: incorporated new error code and styles as per new figma * fix: incorporated new error code and styles as per new figma * Merge branch 'master' into likhith/kyc-195/display-idv-error-messages * fix: reverted changes * Incorporate poi context (binary-com#55) * chore: incorporate POIContext to keep track of submission * chore: reset poi context state upon route change * refactor: added reset for all path * fix: changed testcases --------- Co-authored-by: Likhith Kolayari <likhith@regentmarkets.com> * fix: code smells * chore: trigger rebuild * fix: issue with checkbox * fix: removed unused import * fix: added keyboard event * fix: resolved build failure * Merge branch 'master' into likhith/KYC-363/onfido-sdk-updation * fix: Onfido styles * fix: resolved code-smells --------- Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> Co-authored-by: yauheni-deriv <103182683+yauheni-deriv@users.noreply.github.com> Co-authored-by: Shahzaib <shahzaib@deriv.com>
- Loading branch information
1 parent
f2615da
commit 065ed72
Showing
25 changed files
with
1,321 additions
and
394 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 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.
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
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,56 @@ | ||
import React from 'react'; | ||
import { useLocation } from 'react-router-dom'; | ||
import { ResidenceList } from '@deriv/api-types'; | ||
import { service_code, submission_status_code } from '../Sections/Verification/ProofOfIdentity/proof-of-identity-utils'; | ||
|
||
type TSubmissionStatus = keyof typeof submission_status_code; | ||
type TSubmissionService = keyof typeof service_code; | ||
|
||
type TPOIContext = { | ||
submission_status: TSubmissionStatus; | ||
setSubmissionStatus: React.Dispatch<React.SetStateAction<TSubmissionStatus>>; | ||
submission_service: TSubmissionService; | ||
setSubmissionService: React.Dispatch<React.SetStateAction<TSubmissionService>>; | ||
selected_country: ResidenceList[number]; | ||
setSelectedCountry: React.Dispatch<React.SetStateAction<ResidenceList[number]>>; | ||
}; | ||
|
||
export const POIContextInitialState: TPOIContext = { | ||
submission_status: submission_status_code.selecting, | ||
setSubmissionStatus: () => submission_status_code.selecting, | ||
submission_service: service_code.idv, | ||
setSubmissionService: () => service_code.idv, | ||
selected_country: {}, | ||
setSelectedCountry: () => ({}), | ||
}; | ||
|
||
export const POIContext = React.createContext<TPOIContext>(POIContextInitialState); | ||
|
||
export const POIProvider = ({ children }: React.PropsWithChildren) => { | ||
const [submission_status, setSubmissionStatus] = React.useState<TSubmissionStatus>( | ||
submission_status_code.selecting | ||
); | ||
const [submission_service, setSubmissionService] = React.useState<TSubmissionService>(service_code.idv); | ||
const [selected_country, setSelectedCountry] = React.useState({}); | ||
const location = useLocation(); | ||
|
||
const state = React.useMemo( | ||
() => ({ | ||
submission_status, | ||
setSubmissionStatus, | ||
submission_service, | ||
setSubmissionService, | ||
selected_country, | ||
setSelectedCountry, | ||
}), | ||
[selected_country, submission_service, submission_status] | ||
); | ||
|
||
React.useEffect(() => { | ||
setSubmissionStatus(submission_status_code.selecting); | ||
setSubmissionService(service_code.idv); | ||
setSelectedCountry({}); | ||
}, [location.pathname]); | ||
|
||
return <POIContext.Provider value={state}>{children}</POIContext.Provider>; | ||
}; |
Oops, something went wrong.