-
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.
Implement dAG per project & some UI improvements
- Loading branch information
1 parent
8b60492
commit 5da4210
Showing
31 changed files
with
803 additions
and
546 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
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,36 @@ | ||
import { idOSCredentialStatus } from '@/app/_types/idos'; | ||
import { Grant } from '@idos-network/idos-sdk'; | ||
import { QueryObserverResult, RefetchOptions } from '@tanstack/react-query'; | ||
import { createContext, useContext } from 'react'; | ||
|
||
export type TWallet = { | ||
address: string; | ||
verified: boolean; | ||
}; | ||
|
||
export type TKycContextValue = { | ||
country: string | undefined; | ||
wallet: TWallet | undefined; | ||
id: string | undefined; | ||
status: idOSCredentialStatus | undefined; | ||
isLoading: boolean; | ||
isSuccess: boolean; | ||
error: any; | ||
shares: string[] | undefined; | ||
grants: Grant[] | null | undefined; | ||
refetchGrants: ( | ||
options?: RefetchOptions | undefined, | ||
) => Promise<QueryObserverResult<Grant[] | null | undefined, Error>>; | ||
}; | ||
|
||
export const KycContext = createContext<TKycContextValue | null>(null); | ||
|
||
export const useKyc = () => { | ||
const kyc = useContext(KycContext); | ||
|
||
if (!kyc) { | ||
throw new Error('Kyc is not initialized'); | ||
} | ||
|
||
return kyc; | ||
}; |
Oops, something went wrong.