Render KYC status if flag is enabled

This commit is contained in:
IshaVenikar 2024-08-07 10:33:18 +05:30
parent 2d1d7d36f2
commit 80ce257e00
2 changed files with 21 additions and 13 deletions

View File

@ -8,6 +8,7 @@ import SumsubWebSdk from "@sumsub/websdk-react";
import { MessageHandler } from "@sumsub/websdk"; import { MessageHandler } from "@sumsub/websdk";
import { config, fetchAccessToken, getAccessTokenExpirationHandler, options } from "../utils/sumsub"; import { config, fetchAccessToken, getAccessTokenExpirationHandler, options } from "../utils/sumsub";
import { ENABLE_KYC } from "../constants";
interface Participant { interface Participant {
cosmosAddress: string; cosmosAddress: string;
@ -104,16 +105,21 @@ const OnboardingSuccess = () => {
)} )}
</pre> </pre>
</Box> </Box>
<Typography variant="h5">KYC Status</Typography> {ENABLE_KYC ? (
{!loading && token && cosmosAddress && ( <Box>
<SumsubWebSdk <Typography variant="h5">KYC Status</Typography>
accessToken={token} {!loading && token && cosmosAddress && (
expirationHandler={getAccessTokenExpirationHandler(cosmosAddress)} <SumsubWebSdk
config={config} accessToken={token}
options={options} expirationHandler={getAccessTokenExpirationHandler(cosmosAddress)}
onMessage={messageHandler} config={config}
/> options={options}
)} onMessage={messageHandler}
/>
)}
</Box>
) : ''
}
</Box> </Box>
); );
}; };

View File

@ -2,6 +2,7 @@ import React, { useState, useMemo, useEffect } from "react";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { enqueueSnackbar } from "notistack"; import { enqueueSnackbar } from "notistack";
import canonicalStringify from "canonical-json"; import canonicalStringify from "canonical-json";
import { ethers } from "ethers";
import { import {
Select, Select,
@ -58,7 +59,7 @@ const SignWithNitroKey = () => {
setIsLoading(false) setIsLoading(false)
setEthSignature(ethSignature); setEthSignature(ethSignature);
if(ENABLE_KYC) { if (ENABLE_KYC) {
navigate("/user-verification", { navigate("/user-verification", {
state: { state: {
message, message,
@ -73,8 +74,9 @@ const SignWithNitroKey = () => {
message, message,
cosmosAddress, cosmosAddress,
receivedEthSig, receivedEthSig,
kycId, kycIdHash,
}}) },
});
} }
} catch (error) { } catch (error) {
console.log("err in signing ", error); console.log("err in signing ", error);