astra-sdk-web 1.1.21 → 1.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/astra-sdk.cjs.js +5 -25
- package/dist/astra-sdk.cjs.js.map +1 -1
- package/dist/astra-sdk.es.js +5 -25
- package/dist/astra-sdk.es.js.map +1 -1
- package/dist/components.cjs.js +5 -25
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +5 -25
- package/dist/components.es.js.map +1 -1
- package/package.json +1 -1
- package/src/pages/QRCodePage.tsx +5 -17
package/dist/components.cjs.js
CHANGED
|
@@ -1406,17 +1406,6 @@ function Toast({ message, type = "info", duration = 5e3, onClose }) {
|
|
|
1406
1406
|
}
|
|
1407
1407
|
);
|
|
1408
1408
|
}
|
|
1409
|
-
function ToastContainer({ toasts, onRemove }) {
|
|
1410
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "fixed top-4 right-4 z-[10000] flex flex-col gap-2", children: toasts.map((toast) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1411
|
-
Toast,
|
|
1412
|
-
{
|
|
1413
|
-
message: toast.message,
|
|
1414
|
-
type: toast.type,
|
|
1415
|
-
onClose: () => onRemove(toast.id)
|
|
1416
|
-
},
|
|
1417
|
-
toast.id
|
|
1418
|
-
)) });
|
|
1419
|
-
}
|
|
1420
1409
|
function FaceScanModal({ onComplete }) {
|
|
1421
1410
|
const faceCanvasRef = React.useRef(null);
|
|
1422
1411
|
const navigate = reactRouterDom.useNavigate();
|
|
@@ -1749,14 +1738,6 @@ var MobileRoute_default = MobileRoute;
|
|
|
1749
1738
|
function QRCodePage({ onClose, mobileBaseUrl = "https://kyc-sdk-stage.astraprotocol.com", sessionId, apiBaseUrl, serverKey } = {}) {
|
|
1750
1739
|
const [qrUrl, setQrUrl] = React.useState("");
|
|
1751
1740
|
const [copied, setCopied] = React.useState(false);
|
|
1752
|
-
const [toasts, setToasts] = React.useState([]);
|
|
1753
|
-
const addToast = (message, type = "info") => {
|
|
1754
|
-
const id = `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
1755
|
-
setToasts((prev) => [...prev, { id, message, type }]);
|
|
1756
|
-
};
|
|
1757
|
-
const removeToast = (id) => {
|
|
1758
|
-
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
1759
|
-
};
|
|
1760
1741
|
React.useEffect(() => {
|
|
1761
1742
|
const searchParams = new URLSearchParams(window.location.search);
|
|
1762
1743
|
if (sessionId) {
|
|
@@ -1791,26 +1772,25 @@ function QRCodePage({ onClose, mobileBaseUrl = "https://kyc-sdk-stage.astraproto
|
|
|
1791
1772
|
};
|
|
1792
1773
|
const handleCheckResult = async () => {
|
|
1793
1774
|
if (!apiBaseUrl || !sessionId || !serverKey) {
|
|
1794
|
-
|
|
1775
|
+
alert("Missing configuration to check KYC result.");
|
|
1795
1776
|
return;
|
|
1796
1777
|
}
|
|
1797
1778
|
try {
|
|
1798
1779
|
const svc = new KycApiService({ apiBaseUrl, sessionId, serverKey });
|
|
1799
1780
|
const payload = await svc.getResult();
|
|
1800
1781
|
const first = Array.isArray(payload?.data) && payload.data.length > 0 ? payload.data[0] : null;
|
|
1801
|
-
if (first && first.kyc_status === "verified") {
|
|
1802
|
-
window.location.href =
|
|
1782
|
+
if (first && first.kyc_status === "verified" && first.redirectUrl) {
|
|
1783
|
+
window.location.href = first.redirectUrl;
|
|
1803
1784
|
return;
|
|
1804
1785
|
}
|
|
1805
|
-
|
|
1786
|
+
alert("Please complete your KYC first.");
|
|
1806
1787
|
} catch (error) {
|
|
1807
1788
|
const msg = error?.message || "Result fetch failed";
|
|
1808
1789
|
console.error("getResult:error", msg);
|
|
1809
|
-
|
|
1790
|
+
alert(`Result fetch failed: ${msg}`);
|
|
1810
1791
|
}
|
|
1811
1792
|
};
|
|
1812
1793
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "fixed inset-0 flex items-center justify-center bg-gradient-to-br from-gray-900 via-gray-800 to-black p-4 sm:p-6 md:p-8 z-[1000]", children: [
|
|
1813
|
-
/* @__PURE__ */ jsxRuntime.jsx(ToastContainer, { toasts, onRemove: removeToast }),
|
|
1814
1794
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 opacity-10", style: {
|
|
1815
1795
|
backgroundImage: `radial-gradient(circle at 2px 2px, rgba(255,255,255,0.15) 1px, transparent 0)`,
|
|
1816
1796
|
backgroundSize: "40px 40px"
|