@coinbase/cdp-react 0.0.48 → 0.0.49
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.
|
@@ -31,45 +31,45 @@ import '../../assets/OAuthStatusModal.css';const x = "OAuthStatusModal-module__s
|
|
|
31
31
|
"ring-error": "OAuthStatusModal-module__ring-error___OsgqU",
|
|
32
32
|
invisible: Y
|
|
33
33
|
}, z = ["pending", "success", "error"], pt = () => {
|
|
34
|
-
const [n, e] = b(!1), { oauthState:
|
|
34
|
+
const [n, e] = b(!1), { oauthState: r } = O(), a = I();
|
|
35
35
|
return u(() => {
|
|
36
|
-
if (
|
|
36
|
+
if (r?.status === "pending" || r?.status === "error" || r?.status === "success") {
|
|
37
37
|
const c = sessionStorage.getItem(g);
|
|
38
|
-
if (c === null || c !==
|
|
38
|
+
if (c === null || c !== a)
|
|
39
39
|
return;
|
|
40
40
|
sessionStorage.removeItem(g), e(!0);
|
|
41
41
|
}
|
|
42
|
-
}, [
|
|
42
|
+
}, [r?.status, a]), /* @__PURE__ */ s($, { open: n, onOpenChange: e, children: /* @__PURE__ */ o(w, { children: [
|
|
43
43
|
/* @__PURE__ */ s(f, { children: /* @__PURE__ */ s(E, { children: "OAuth Status" }) }),
|
|
44
44
|
/* @__PURE__ */ s(f, { children: /* @__PURE__ */ o(P, { children: [
|
|
45
45
|
"Sign in with ",
|
|
46
|
-
d(
|
|
46
|
+
d(a),
|
|
47
47
|
" ",
|
|
48
|
-
|
|
48
|
+
r?.status ? `${r?.status === "success" ? "successful" : r?.status === "error" ? "failed" : "pending"}` : ""
|
|
49
49
|
] }) }),
|
|
50
50
|
/* @__PURE__ */ s(V, { handleClose: () => e(!1) })
|
|
51
51
|
] }) });
|
|
52
52
|
}, V = ({ handleClose: n }) => {
|
|
53
|
-
const { oauthState: e } = O(),
|
|
53
|
+
const { oauthState: e } = O(), r = e?.providerType || "google", { timeRemaining: a, start: c, reset: m } = y(), _ = S(null), h = S(null), A = 250, p = v((i) => {
|
|
54
54
|
h.current === i || i === void 0 || (h.current = i, _.current?.transition.toggle(i));
|
|
55
55
|
}, []);
|
|
56
56
|
return u(() => {
|
|
57
57
|
p(e?.status), e?.status === "success" && c(3);
|
|
58
58
|
}, [e?.status, p, c]), u(() => {
|
|
59
|
-
|
|
60
|
-
}, [
|
|
59
|
+
a !== null && a <= 0 && (m(), n());
|
|
60
|
+
}, [a, m, n]), /* @__PURE__ */ o("div", { className: t["oauth-status-modal"], children: [
|
|
61
61
|
/* @__PURE__ */ s(
|
|
62
62
|
R,
|
|
63
63
|
{
|
|
64
64
|
animateHeight: !1,
|
|
65
65
|
timeout: A,
|
|
66
66
|
items: z,
|
|
67
|
-
initialEntered: !
|
|
67
|
+
initialEntered: !1,
|
|
68
68
|
transitionRef: _,
|
|
69
69
|
className: t["transition-wrapper"],
|
|
70
70
|
children: ({ itemKey: i, ...M }) => {
|
|
71
71
|
const N = X[i];
|
|
72
|
-
return /* @__PURE__ */ s("div", { ...M, className: t.status, children: /* @__PURE__ */ s(N, { timeRemaining:
|
|
72
|
+
return /* @__PURE__ */ s("div", { ...M, className: t.status, children: /* @__PURE__ */ s(N, { timeRemaining: a, provider: r }) });
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cdp-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.49",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@internationalized/number": "3.6.4",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"react": ">=18.2.0 <19.2.0",
|
|
17
|
-
"@coinbase/cdp-core": "^0.0.
|
|
18
|
-
"@coinbase/cdp-hooks": "^0.0.
|
|
17
|
+
"@coinbase/cdp-core": "^0.0.49",
|
|
18
|
+
"@coinbase/cdp-hooks": "^0.0.49"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@size-limit/preset-big-lib": "^11.2.0",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"vite": "^7.0.4",
|
|
46
46
|
"vite-plugin-dts": "^4.5.4",
|
|
47
47
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
48
|
-
"@coinbase/cdp-core": "^0.0.
|
|
49
|
-
"@coinbase/cdp-hooks": "^0.0.
|
|
48
|
+
"@coinbase/cdp-core": "^0.0.49",
|
|
49
|
+
"@coinbase/cdp-hooks": "^0.0.49"
|
|
50
50
|
},
|
|
51
51
|
"size-limit": [
|
|
52
52
|
{
|