From 80573a2adefaea88b3e43b7225c2b04d514e7dc7 Mon Sep 17 00:00:00 2001 From: Vlad Frolov Date: Sun, 3 Nov 2024 07:42:44 +0100 Subject: [PATCH] feat: Added KYC expiration support (backend has been migrated to the new Shuttle infrastructure / URL) --- .../entity/proposal/VerificationStatus.jsx | 13 +-- .../entity/proposal/VerificationStatus.jsx | 82 +++++++++++-------- 2 files changed, 54 insertions(+), 41 deletions(-) diff --git a/instances/devhub.near/widget/devhub/entity/proposal/VerificationStatus.jsx b/instances/devhub.near/widget/devhub/entity/proposal/VerificationStatus.jsx index f9e9b699e..d63ab0fbf 100644 --- a/instances/devhub.near/widget/devhub/entity/proposal/VerificationStatus.jsx +++ b/instances/devhub.near/widget/devhub/entity/proposal/VerificationStatus.jsx @@ -16,18 +16,21 @@ useEffect(() => { (receiverAccount ?? "").includes(".tg") ) { asyncFetch( - `https://neardevhub-kyc-proxy.shuttleapp.rs/kyc/${receiverAccount}` + `https://neardevhub-kyc-proxy-gvbr.shuttle.app/kyc/${receiverAccount}` ).then((res) => { let displayableText = ""; switch (res.body.kyc_status) { - case "Approved": + case "APPROVED": displayableText = "Verified"; break; - case "Pending": + case "PENDING": displayableText = "Pending"; break; - case "NotSubmitted": - case "Rejected": + case "EXPIRED": + displayableText = "Expired"; + break; + case "NOT_SUBMITTED": + case "REJECTED": displayableText = "Not Verfied"; break; default: diff --git a/instances/events-committee.near/widget/devhub/entity/proposal/VerificationStatus.jsx b/instances/events-committee.near/widget/devhub/entity/proposal/VerificationStatus.jsx index a33a0181a..d63ab0fbf 100644 --- a/instances/events-committee.near/widget/devhub/entity/proposal/VerificationStatus.jsx +++ b/instances/events-committee.near/widget/devhub/entity/proposal/VerificationStatus.jsx @@ -15,28 +15,30 @@ 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; - default: - displayableText = "Not Verfied"; - break; - } - setVerificationStatus(displayableText); - }), - "ky-check-proposal" + receiverAccount, - { subscribe: false } - ); + asyncFetch( + `https://neardevhub-kyc-proxy-gvbr.shuttle.app/kyc/${receiverAccount}` + ).then((res) => { + let displayableText = ""; + switch (res.body.kyc_status) { + case "APPROVED": + displayableText = "Verified"; + break; + case "PENDING": + displayableText = "Pending"; + break; + case "EXPIRED": + displayableText = "Expired"; + break; + case "NOT_SUBMITTED": + case "REJECTED": + displayableText = "Not Verfied"; + break; + default: + displayableText = "Failed to get status"; + break; + } + setVerificationStatus(displayableText); + }); } }, [receiverAccount]); @@ -233,21 +235,29 @@ const VerificationBtn = () => { return (
-
-
- -
-
Fractal
-
{verificationStatus}
+ {!verificationStatus ? ( +
+ )}
);