Skip to content

Commit

Permalink
fix fractal verification issue (#927)
Browse files Browse the repository at this point in the history
  • Loading branch information
Megha-Dev-19 authored Aug 25, 2024
1 parent 1dd7938 commit af5c964
Showing 1 changed file with 43 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,27 @@ useEffect(() => {
(receiverAccount ?? "").includes(".near") ||
(receiverAccount ?? "").includes(".tg")
) {
useCache(
() =>
asyncFetch(
`https://neardevhub-kyc-proxy.shuttleapp.rs/kyc/${receiverAccount}`
).then((res) => {
let displayableText = "";
switch (res.body.kyc_status) {
case "Approved":
displayableText = "Verified";
break;
case "Pending":
displayableText = "Pending";
break;
case "NotSubmitted":
case "Rejected":
displayableText = "Not Verfied";
break;
default:
displayableText = "Failed to get status";
break;
}
setVerificationStatus(displayableText);
}),
"ky-check-proposal" + receiverAccount,
{ subscribe: false }
);
asyncFetch(
`https://neardevhub-kyc-proxy.shuttleapp.rs/kyc/${receiverAccount}`
).then((res) => {
let displayableText = "";
switch (res.body.kyc_status) {
case "Approved":
displayableText = "Verified";
break;
case "Pending":
displayableText = "Pending";
break;
case "NotSubmitted":
case "Rejected":
displayableText = "Not Verfied";
break;
default:
displayableText = "Failed to get status";
break;
}
setVerificationStatus(displayableText);
});
}
}, [receiverAccount]);

Expand Down Expand Up @@ -237,21 +232,29 @@ const VerificationBtn = () => {

return (
<div>
<div className="d-flex text-black justify-content-between align-items-center">
<div className="d-flex" style={{ gap: "12px" }}>
<img
className="align-self-center object-fit-cover"
src={verificationStatus === "Verified" ? SuccessImg : WarningImg}
height={imageSize}
/>
<div className="d-flex flex-column justify-content-center">
<div className="h6 mb-0">Fractal</div>
<div className="text-sm text-muted">{verificationStatus}</div>
{!verificationStatus ? (
<span
className="spinner-grow spinner-grow-sm me-1"
role="status"
aria-hidden="true"
/>
) : (
<div className="d-flex text-black justify-content-between align-items-center">
<div className="d-flex" style={{ gap: "12px" }}>
<img
className="align-self-center object-fit-cover"
src={verificationStatus === "Verified" ? SuccessImg : WarningImg}
height={imageSize}
/>
<div className="d-flex flex-column justify-content-center">
<div className="h6 mb-0">Fractal</div>
<div className="text-sm text-muted">{verificationStatus}</div>
</div>
</div>
{verificationStatus !== "Verified" && showGetVerifiedBtn && (
<VerificationBtn />
)}
</div>
{verificationStatus !== "Verified" && showGetVerifiedBtn && (
<VerificationBtn />
)}
</div>
)}
</div>
);

0 comments on commit af5c964

Please sign in to comment.