-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implemented redirects handling (#2715)
* feat: implemented redirects handling * fix: removed debugger & added loading screen to failed
- Loading branch information
1 parent
26d22ad
commit d763a65
Showing
10 changed files
with
58 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './useUIOptionsRedirect'; |
13 changes: 13 additions & 0 deletions
13
apps/kyb-app/src/hooks/useUIOptionsRedirect/useUIOptionsRedirect.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,13 @@ | ||
import { useLanguage } from '@/hooks/useLanguage'; | ||
import { useUISchemasQuery } from '@/hooks/useUISchemasQuery'; | ||
import { useEffect } from 'react'; | ||
|
||
export const useUIOptionsRedirect = (state: 'success' | 'failure') => { | ||
const { data } = useUISchemasQuery(useLanguage()); | ||
|
||
useEffect(() => { | ||
if (data?.uiOptions?.redirectUrls?.[state]) { | ||
location.href = data.uiOptions.redirectUrls?.[state] as string; | ||
} | ||
}, [data, state]); | ||
}; |
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
8 changes: 8 additions & 0 deletions
8
apps/kyb-app/src/pages/CollectionFlow/components/pages/Failed/Failed.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,8 @@ | ||
import { LoadingScreen } from '@/common/components/molecules/LoadingScreen'; | ||
import { useUIOptionsRedirect } from '@/hooks/useUIOptionsRedirect'; | ||
|
||
export const Failed = () => { | ||
useUIOptionsRedirect('failure'); | ||
|
||
return <LoadingScreen />; | ||
}; |
1 change: 1 addition & 0 deletions
1
apps/kyb-app/src/pages/CollectionFlow/components/pages/Failed/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 * from './Failed'; |
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
Submodule data-migrations
updated
from 7cb730 to 86f4d3
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