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/astra-sdk.cjs.js
CHANGED
|
@@ -1611,17 +1611,6 @@ function Toast({ message, type = "info", duration = 5e3, onClose }) {
|
|
|
1611
1611
|
}
|
|
1612
1612
|
);
|
|
1613
1613
|
}
|
|
1614
|
-
function ToastContainer({ toasts, onRemove }) {
|
|
1615
|
-
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(
|
|
1616
|
-
Toast,
|
|
1617
|
-
{
|
|
1618
|
-
message: toast.message,
|
|
1619
|
-
type: toast.type,
|
|
1620
|
-
onClose: () => onRemove(toast.id)
|
|
1621
|
-
},
|
|
1622
|
-
toast.id
|
|
1623
|
-
)) });
|
|
1624
|
-
}
|
|
1625
1614
|
function FaceScanModal({ onComplete }) {
|
|
1626
1615
|
const faceCanvasRef = React.useRef(null);
|
|
1627
1616
|
const navigate = reactRouterDom.useNavigate();
|
|
@@ -1954,14 +1943,6 @@ var MobileRoute_default = MobileRoute;
|
|
|
1954
1943
|
function QRCodePage({ onClose, mobileBaseUrl = "https://kyc-sdk-stage.astraprotocol.com", sessionId, apiBaseUrl, serverKey } = {}) {
|
|
1955
1944
|
const [qrUrl, setQrUrl] = React.useState("");
|
|
1956
1945
|
const [copied, setCopied] = React.useState(false);
|
|
1957
|
-
const [toasts, setToasts] = React.useState([]);
|
|
1958
|
-
const addToast = (message, type = "info") => {
|
|
1959
|
-
const id = `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
1960
|
-
setToasts((prev) => [...prev, { id, message, type }]);
|
|
1961
|
-
};
|
|
1962
|
-
const removeToast = (id) => {
|
|
1963
|
-
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
1964
|
-
};
|
|
1965
1946
|
React.useEffect(() => {
|
|
1966
1947
|
const searchParams = new URLSearchParams(window.location.search);
|
|
1967
1948
|
if (sessionId) {
|
|
@@ -1996,26 +1977,25 @@ function QRCodePage({ onClose, mobileBaseUrl = "https://kyc-sdk-stage.astraproto
|
|
|
1996
1977
|
};
|
|
1997
1978
|
const handleCheckResult = async () => {
|
|
1998
1979
|
if (!apiBaseUrl || !sessionId || !serverKey) {
|
|
1999
|
-
|
|
1980
|
+
alert("Missing configuration to check KYC result.");
|
|
2000
1981
|
return;
|
|
2001
1982
|
}
|
|
2002
1983
|
try {
|
|
2003
1984
|
const svc = new KycApiService({ apiBaseUrl, sessionId, serverKey });
|
|
2004
1985
|
const payload = await svc.getResult();
|
|
2005
1986
|
const first = Array.isArray(payload?.data) && payload.data.length > 0 ? payload.data[0] : null;
|
|
2006
|
-
if (first && first.kyc_status === "verified") {
|
|
2007
|
-
window.location.href =
|
|
1987
|
+
if (first && first.kyc_status === "verified" && first.redirectUrl) {
|
|
1988
|
+
window.location.href = first.redirectUrl;
|
|
2008
1989
|
return;
|
|
2009
1990
|
}
|
|
2010
|
-
|
|
1991
|
+
alert("Please complete your KYC first.");
|
|
2011
1992
|
} catch (error) {
|
|
2012
1993
|
const msg = error?.message || "Result fetch failed";
|
|
2013
1994
|
console.error("getResult:error", msg);
|
|
2014
|
-
|
|
1995
|
+
alert(`Result fetch failed: ${msg}`);
|
|
2015
1996
|
}
|
|
2016
1997
|
};
|
|
2017
1998
|
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: [
|
|
2018
|
-
/* @__PURE__ */ jsxRuntime.jsx(ToastContainer, { toasts, onRemove: removeToast }),
|
|
2019
1999
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 opacity-10", style: {
|
|
2020
2000
|
backgroundImage: `radial-gradient(circle at 2px 2px, rgba(255,255,255,0.15) 1px, transparent 0)`,
|
|
2021
2001
|
backgroundSize: "40px 40px"
|