@crossmint/client-sdk-react-ui 0.0.8-alpha.0 → 0.0.8-alpha.4
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/LICENSE +201 -201
- package/lib/cjs/CrossMintButton.d.ts +16 -16
- package/lib/cjs/CrossMintButton.js +59 -59
- package/lib/cjs/CrossMintModal.d.ts +6 -6
- package/lib/cjs/CrossMintModal.js +54 -54
- package/lib/cjs/CrossMintModal.js.map +1 -1
- package/lib/cjs/CrossMintModalProvider.d.ts +6 -6
- package/lib/cjs/CrossMintModalProvider.js +47 -47
- package/lib/cjs/CrossMintPopupProvider.d.ts +6 -6
- package/lib/cjs/CrossMintPopupProvider.js +69 -69
- package/lib/cjs/CrossMintPopupProvider.js.map +1 -1
- package/lib/cjs/CrossMintProvider.d.ts +10 -9
- package/lib/cjs/CrossMintProvider.js +51 -51
- package/lib/cjs/CrossMintProvider.js.map +1 -1
- package/lib/cjs/CrossMintStatusButton.d.ts +10 -10
- package/lib/cjs/CrossMintStatusButton.js +65 -65
- package/lib/cjs/CrossMintStatusButton.js.map +1 -1
- package/lib/cjs/CrossMintStatusProvider.d.ts +8 -7
- package/lib/cjs/CrossMintStatusProvider.js +69 -64
- package/lib/cjs/CrossMintStatusProvider.js.map +1 -1
- package/lib/cjs/index.d.ts +7 -7
- package/lib/cjs/index.js +19 -19
- package/lib/cjs/package.json +1 -3
- package/lib/cjs/useCrossMintModal.d.ts +7 -7
- package/lib/cjs/useCrossMintModal.js +9 -9
- package/lib/cjs/useCrossMintPopup.d.ts +8 -8
- package/lib/cjs/useCrossMintPopup.js +9 -9
- package/lib/cjs/useCrossMintStatus.d.ts +16 -15
- package/lib/cjs/useCrossMintStatus.js +17 -17
- package/lib/cjs/useCrossMintStatus.js.map +1 -1
- package/lib/esm/CrossMintButton.d.ts +16 -16
- package/lib/esm/CrossMintButton.js +24 -24
- package/lib/esm/CrossMintModal.d.ts +6 -6
- package/lib/esm/CrossMintModal.js +31 -31
- package/lib/esm/CrossMintModal.js.map +1 -1
- package/lib/esm/CrossMintModalProvider.d.ts +6 -6
- package/lib/esm/CrossMintModalProvider.js +12 -12
- package/lib/esm/CrossMintPopupProvider.d.ts +6 -6
- package/lib/esm/CrossMintPopupProvider.js +46 -46
- package/lib/esm/CrossMintPopupProvider.js.map +1 -1
- package/lib/esm/CrossMintProvider.d.ts +10 -9
- package/lib/esm/CrossMintProvider.js +16 -16
- package/lib/esm/CrossMintProvider.js.map +1 -1
- package/lib/esm/CrossMintStatusButton.d.ts +10 -10
- package/lib/esm/CrossMintStatusButton.js +30 -30
- package/lib/esm/CrossMintStatusButton.js.map +1 -1
- package/lib/esm/CrossMintStatusProvider.d.ts +8 -7
- package/lib/esm/CrossMintStatusProvider.js +35 -30
- package/lib/esm/CrossMintStatusProvider.js.map +1 -1
- package/lib/esm/index.d.ts +7 -7
- package/lib/esm/index.js +7 -7
- package/lib/esm/useCrossMintModal.d.ts +7 -7
- package/lib/esm/useCrossMintModal.js +5 -5
- package/lib/esm/useCrossMintPopup.d.ts +8 -8
- package/lib/esm/useCrossMintPopup.js +5 -5
- package/lib/esm/useCrossMintStatus.d.ts +16 -15
- package/lib/esm/useCrossMintStatus.js +13 -13
- package/lib/esm/useCrossMintStatus.js.map +1 -1
- package/package.json +2 -3
- package/src/CrossMintModal.tsx +54 -54
- package/src/CrossMintPopupProvider.tsx +9 -9
- package/src/CrossMintStatusButton.tsx +2 -2
- package/src/CrossMintStatusProvider.tsx +5 -0
- package/src/useCrossMintModal.tsx +12 -12
- package/lib/esm/package.json +0 -3
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import React, { useCallback, useLayoutEffect, useRef, useState } from "react";
|
|
2
|
-
import { createPortal } from "react-dom";
|
|
3
|
-
import { useCrossMintModal } from "./useCrossMintModal";
|
|
4
|
-
export const CrossMintModal = ({ className = "", container = "body" }) => {
|
|
5
|
-
const ref = useRef(null);
|
|
6
|
-
const { setVisible } = useCrossMintModal();
|
|
7
|
-
const [fadeIn, setFadeIn] = useState(false);
|
|
8
|
-
const [portal, setPortal] = useState(null);
|
|
9
|
-
const hideModal = useCallback(() => {
|
|
10
|
-
setFadeIn(false);
|
|
11
|
-
setTimeout(() => setVisible(false), 150);
|
|
12
|
-
}, [setFadeIn, setVisible]);
|
|
13
|
-
useLayoutEffect(() => {
|
|
14
|
-
// Get original overflow
|
|
15
|
-
const { overflow } = window.getComputedStyle(document.body);
|
|
16
|
-
// Hack to enable fade in animation after mount
|
|
17
|
-
setTimeout(() => setFadeIn(true), 0);
|
|
18
|
-
// Prevent scrolling on mount
|
|
19
|
-
document.body.style.overflow = "hidden";
|
|
20
|
-
return () => {
|
|
21
|
-
// Re-enable scrolling when component unmounts
|
|
22
|
-
document.body.style.overflow = overflow;
|
|
23
|
-
};
|
|
24
|
-
}, [hideModal]);
|
|
25
|
-
useLayoutEffect(() => setPortal(document.querySelector(container)), [setPortal, container]);
|
|
26
|
-
return (portal &&
|
|
27
|
-
createPortal(React.createElement("div", { "aria-modal": "true", className: `client-sdk-modal ${fadeIn
|
|
28
|
-
React.createElement("div", { className: "client-sdk-modal-container" },
|
|
29
|
-
React.createElement("span", { className: "client-sdk-modal-loader" })),
|
|
30
|
-
React.createElement("div", { className: "client-sdk-modal-overlay" })), portal));
|
|
31
|
-
};
|
|
1
|
+
import React, { useCallback, useLayoutEffect, useRef, useState } from "react";
|
|
2
|
+
import { createPortal } from "react-dom";
|
|
3
|
+
import { useCrossMintModal } from "./useCrossMintModal";
|
|
4
|
+
export const CrossMintModal = ({ className = "", container = "body" }) => {
|
|
5
|
+
const ref = useRef(null);
|
|
6
|
+
const { setVisible } = useCrossMintModal();
|
|
7
|
+
const [fadeIn, setFadeIn] = useState(false);
|
|
8
|
+
const [portal, setPortal] = useState(null);
|
|
9
|
+
const hideModal = useCallback(() => {
|
|
10
|
+
setFadeIn(false);
|
|
11
|
+
setTimeout(() => setVisible(false), 150);
|
|
12
|
+
}, [setFadeIn, setVisible]);
|
|
13
|
+
useLayoutEffect(() => {
|
|
14
|
+
// Get original overflow
|
|
15
|
+
const { overflow } = window.getComputedStyle(document.body);
|
|
16
|
+
// Hack to enable fade in animation after mount
|
|
17
|
+
setTimeout(() => setFadeIn(true), 0);
|
|
18
|
+
// Prevent scrolling on mount
|
|
19
|
+
document.body.style.overflow = "hidden";
|
|
20
|
+
return () => {
|
|
21
|
+
// Re-enable scrolling when component unmounts
|
|
22
|
+
document.body.style.overflow = overflow;
|
|
23
|
+
};
|
|
24
|
+
}, [hideModal]);
|
|
25
|
+
useLayoutEffect(() => setPortal(document.querySelector(container)), [setPortal, container]);
|
|
26
|
+
return (portal &&
|
|
27
|
+
createPortal(React.createElement("div", { "aria-modal": "true", className: `client-sdk-modal ${fadeIn ? "client-sdk-modal-fade-in" : ""} ${className}`, ref: ref },
|
|
28
|
+
React.createElement("div", { className: "client-sdk-modal-container" },
|
|
29
|
+
React.createElement("span", { className: "client-sdk-modal-loader" })),
|
|
30
|
+
React.createElement("div", { className: "client-sdk-modal-overlay" })), portal));
|
|
31
|
+
};
|
|
32
32
|
//# sourceMappingURL=CrossMintModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CrossMintModal.js","sourceRoot":"","sources":["../../src/CrossMintModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,WAAW,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAOxD,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,SAAS,GAAG,MAAM,EAAE,EAAE,EAAE;IAC9F,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACzC,MAAM,EAAE,UAAU,EAAE,GAAG,iBAAiB,EAAE,CAAC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C5C,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,eAAe,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;IAE5F,OAAO,CACH,MAAM;QACN,YAAY,CACR,2CACe,MAAM,EACjB,SAAS,EAAE,oBAAoB,MAAM,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,IAAI,SAAS,EAAE,EACtF,GAAG,EAAE,GAAG;YAER,6BAAK,SAAS,EAAC,4BAA4B;gBACvC,8BAAM,SAAS,EAAC,yBAAyB,GAAG,CAC1C;YACN,6BAAK,SAAS,EAAC,0BAA0B,GAAG,CAC1C,EACN,MAAM,CACT,CACJ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FC, ReactNode } from "react";
|
|
2
|
-
import { CrossMintModalProps } from "./CrossMintModal";
|
|
3
|
-
export interface CrossMintModalProviderProps extends CrossMintModalProps {
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
}
|
|
6
|
-
export declare const CrossMintModalProvider: FC<CrossMintModalProviderProps>;
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
import { CrossMintModalProps } from "./CrossMintModal";
|
|
3
|
+
export interface CrossMintModalProviderProps extends CrossMintModalProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const CrossMintModalProvider: FC<CrossMintModalProviderProps>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import { CrossMintModal } from "./CrossMintModal";
|
|
3
|
-
import { CrossMintModalContext } from "./useCrossMintModal";
|
|
4
|
-
export const CrossMintModalProvider = ({ children, ...props }) => {
|
|
5
|
-
const [visible, setVisible] = useState(false);
|
|
6
|
-
return (React.createElement(CrossMintModalContext.Provider, { value: {
|
|
7
|
-
visible,
|
|
8
|
-
setVisible,
|
|
9
|
-
} },
|
|
10
|
-
children,
|
|
11
|
-
visible && React.createElement(CrossMintModal, { ...props })));
|
|
12
|
-
};
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { CrossMintModal } from "./CrossMintModal";
|
|
3
|
+
import { CrossMintModalContext } from "./useCrossMintModal";
|
|
4
|
+
export const CrossMintModalProvider = ({ children, ...props }) => {
|
|
5
|
+
const [visible, setVisible] = useState(false);
|
|
6
|
+
return (React.createElement(CrossMintModalContext.Provider, { value: {
|
|
7
|
+
visible,
|
|
8
|
+
setVisible,
|
|
9
|
+
} },
|
|
10
|
+
children,
|
|
11
|
+
visible && React.createElement(CrossMintModal, { ...props })));
|
|
12
|
+
};
|
|
13
13
|
//# sourceMappingURL=CrossMintModalProvider.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FC, ReactNode } from "react";
|
|
2
|
-
export interface PopupProviderProps {
|
|
3
|
-
development: boolean;
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
}
|
|
6
|
-
export declare const CrossMintPopupProvider: FC<PopupProviderProps>;
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
export interface PopupProviderProps {
|
|
3
|
+
development: boolean;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const CrossMintPopupProvider: FC<PopupProviderProps>;
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import { useCrossMintModal, useCrossMintStatus } from ".";
|
|
3
|
-
import { PopupContext } from "./useCrossMintPopup";
|
|
4
|
-
const PROD_URL = "https://crossmint.io";
|
|
5
|
-
const DEV_URL = "http://localhost:3001";
|
|
6
|
-
export const CrossMintPopupProvider = ({ development, children }) => {
|
|
7
|
-
const [connecting, setConnecting] = useState(false);
|
|
8
|
-
const [popup, setPopup] = useState(null);
|
|
9
|
-
const { clientId } = useCrossMintStatus();
|
|
10
|
-
const { setVisible } = useCrossMintModal();
|
|
11
|
-
const createPopup = (collectionTitle, collectionDescription, collectionPhoto, mintTo, emailTo, listingId) => {
|
|
12
|
-
const pop = window.open(`${development ? DEV_URL : PROD_URL}/signin?callbackUrl=${encodeURIComponent(`${development ? DEV_URL : PROD_URL}/checkout/mint?clientId=${clientId}&closeOnSuccess=false
|
|
13
|
-
if (pop) {
|
|
14
|
-
setVisible(true);
|
|
15
|
-
setPopup(pop);
|
|
16
|
-
registerListeners(pop);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
setConnecting(false);
|
|
20
|
-
console.log("Failed to open popup window");
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
const connect = (collectionTitle, collectionDescription, collectionPhoto, mintTo, emailTo, listingId) => {
|
|
24
|
-
if (connecting)
|
|
25
|
-
return;
|
|
26
|
-
setConnecting(true);
|
|
27
|
-
createPopup(collectionTitle, collectionDescription, collectionPhoto, mintTo, emailTo, listingId);
|
|
28
|
-
};
|
|
29
|
-
function registerListeners(pop) {
|
|
30
|
-
const timer = setInterval(function () {
|
|
31
|
-
if (pop.closed) {
|
|
32
|
-
clearInterval(timer);
|
|
33
|
-
setConnecting(false);
|
|
34
|
-
setVisible(false);
|
|
35
|
-
}
|
|
36
|
-
}, 500);
|
|
37
|
-
}
|
|
38
|
-
function createPopupString() {
|
|
39
|
-
return `height=750,width=400,left=${window.innerWidth / 2 - 200},top=${window.innerHeight / 2 - 375},resizable=yes,scrollbars=yes,toolbar=yes,menubar=true,location=no,directories=no, status=yes`;
|
|
40
|
-
}
|
|
41
|
-
return (React.createElement(PopupContext.Provider, { value: {
|
|
42
|
-
connecting,
|
|
43
|
-
popup,
|
|
44
|
-
connect,
|
|
45
|
-
} }, children));
|
|
46
|
-
};
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { useCrossMintModal, useCrossMintStatus } from ".";
|
|
3
|
+
import { PopupContext } from "./useCrossMintPopup";
|
|
4
|
+
const PROD_URL = "https://www.crossmint.io";
|
|
5
|
+
const DEV_URL = "http://localhost:3001";
|
|
6
|
+
export const CrossMintPopupProvider = ({ development, children }) => {
|
|
7
|
+
const [connecting, setConnecting] = useState(false);
|
|
8
|
+
const [popup, setPopup] = useState(null);
|
|
9
|
+
const { clientId } = useCrossMintStatus();
|
|
10
|
+
const { setVisible } = useCrossMintModal();
|
|
11
|
+
const createPopup = (collectionTitle, collectionDescription, collectionPhoto, mintTo, emailTo, listingId) => {
|
|
12
|
+
const pop = window.open(`${development ? DEV_URL : PROD_URL}/signin?callbackUrl=${encodeURIComponent(`${development ? DEV_URL : PROD_URL}/checkout/mint?clientId=${encodeURIComponent(clientId)}&closeOnSuccess=false&${collectionTitle ? `collectionTitle=${encodeURIComponent(collectionTitle)}` : ""}${collectionDescription ? `&collectionDescription=${encodeURIComponent(collectionDescription)}` : ""}${collectionPhoto ? `&collectionPhoto=${encodeURIComponent(collectionPhoto)}` : ""}${mintTo ? `&mintTo=${encodeURIComponent(mintTo)}` : ""}${emailTo ? `&emailTo=${encodeURIComponent(emailTo)}` : ""}${listingId ? `&listingId=${encodeURIComponent(listingId)}` : ""}`)}`, "popUpWindow", createPopupString());
|
|
13
|
+
if (pop) {
|
|
14
|
+
setVisible(true);
|
|
15
|
+
setPopup(pop);
|
|
16
|
+
registerListeners(pop);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
setConnecting(false);
|
|
20
|
+
console.log("Failed to open popup window");
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const connect = (collectionTitle, collectionDescription, collectionPhoto, mintTo, emailTo, listingId) => {
|
|
24
|
+
if (connecting)
|
|
25
|
+
return;
|
|
26
|
+
setConnecting(true);
|
|
27
|
+
createPopup(collectionTitle, collectionDescription, collectionPhoto, mintTo, emailTo, listingId);
|
|
28
|
+
};
|
|
29
|
+
function registerListeners(pop) {
|
|
30
|
+
const timer = setInterval(function () {
|
|
31
|
+
if (pop.closed) {
|
|
32
|
+
clearInterval(timer);
|
|
33
|
+
setConnecting(false);
|
|
34
|
+
setVisible(false);
|
|
35
|
+
}
|
|
36
|
+
}, 500);
|
|
37
|
+
}
|
|
38
|
+
function createPopupString() {
|
|
39
|
+
return `height=750,width=400,left=${window.innerWidth / 2 - 200},top=${window.innerHeight / 2 - 375},resizable=yes,scrollbars=yes,toolbar=yes,menubar=true,location=no,directories=no, status=yes`;
|
|
40
|
+
}
|
|
41
|
+
return (React.createElement(PopupContext.Provider, { value: {
|
|
42
|
+
connecting,
|
|
43
|
+
popup,
|
|
44
|
+
connect,
|
|
45
|
+
} }, children));
|
|
46
|
+
};
|
|
47
47
|
//# sourceMappingURL=CrossMintPopupProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CrossMintPopupProvider.js","sourceRoot":"","sources":["../../src/CrossMintPopupProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,QAAQ,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,GAAG,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAOnD,MAAM,QAAQ,GAAG,
|
|
1
|
+
{"version":3,"file":"CrossMintPopupProvider.js","sourceRoot":"","sources":["../../src/CrossMintPopupProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,QAAQ,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,GAAG,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAOnD,MAAM,QAAQ,GAAG,0BAA0B,CAAC;AAC5C,MAAM,OAAO,GAAG,uBAAuB,CAAC;AAExC,MAAM,CAAC,MAAM,sBAAsB,GAA2B,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE;IACxF,MAAM,CAAC,UAAU,EAA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
-
export interface CrossMintProviderProps extends CrossMintModalProps {
|
|
4
|
-
clientId: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
import { CrossMintModalProps } from "./CrossMintModal";
|
|
3
|
+
export interface CrossMintProviderProps extends CrossMintModalProps {
|
|
4
|
+
clientId: string;
|
|
5
|
+
auctionId?: string;
|
|
6
|
+
hideMintOnInactiveClient?: boolean;
|
|
7
|
+
development?: boolean;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const CrossMintProvider: FC<CrossMintProviderProps>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import { CrossMintModal } from "./CrossMintModal";
|
|
3
|
-
import { CrossMintPopupProvider } from "./CrossMintPopupProvider";
|
|
4
|
-
import { CrossMintStatusProvider } from "./CrossMintStatusProvider";
|
|
5
|
-
import { CrossMintModalContext } from "./useCrossMintModal";
|
|
6
|
-
export const CrossMintProvider = ({ clientId, hideMintOnInactiveClient = false, development = false, children, ...props }) => {
|
|
7
|
-
const [visible, setVisible] = useState(false);
|
|
8
|
-
return (React.createElement(CrossMintStatusProvider, { clientId: clientId, hideMintOnInactiveClient: hideMintOnInactiveClient },
|
|
9
|
-
React.createElement(CrossMintModalContext.Provider, { value: {
|
|
10
|
-
visible,
|
|
11
|
-
setVisible,
|
|
12
|
-
} },
|
|
13
|
-
React.createElement(CrossMintPopupProvider, { development: development },
|
|
14
|
-
children,
|
|
15
|
-
visible && React.createElement(CrossMintModal, { ...props })))));
|
|
16
|
-
};
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { CrossMintModal } from "./CrossMintModal";
|
|
3
|
+
import { CrossMintPopupProvider } from "./CrossMintPopupProvider";
|
|
4
|
+
import { CrossMintStatusProvider } from "./CrossMintStatusProvider";
|
|
5
|
+
import { CrossMintModalContext } from "./useCrossMintModal";
|
|
6
|
+
export const CrossMintProvider = ({ clientId, auctionId, hideMintOnInactiveClient = false, development = false, children, ...props }) => {
|
|
7
|
+
const [visible, setVisible] = useState(false);
|
|
8
|
+
return (React.createElement(CrossMintStatusProvider, { clientId: clientId, hideMintOnInactiveClient: hideMintOnInactiveClient, auctionId: auctionId },
|
|
9
|
+
React.createElement(CrossMintModalContext.Provider, { value: {
|
|
10
|
+
visible,
|
|
11
|
+
setVisible,
|
|
12
|
+
} },
|
|
13
|
+
React.createElement(CrossMintPopupProvider, { development: development },
|
|
14
|
+
children,
|
|
15
|
+
visible && React.createElement(CrossMintModal, { ...props })))));
|
|
16
|
+
};
|
|
17
17
|
//# sourceMappingURL=CrossMintProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CrossMintProvider.js","sourceRoot":"","sources":["../../src/CrossMintProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,QAAQ,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,cAAc,EAAuB,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"CrossMintProvider.js","sourceRoot":"","sources":["../../src/CrossMintProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,QAAQ,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,cAAc,EAAuB,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAU5D,MAAM,CAAC,MAAM,iBAAiB,GAA+B,CAAC,EAC1D,QAAQ,EACR,SAAS,EACT,wBAAwB,GAAG,KAAK,EAChC,WAAW,GAAG,KAAK,EACnB,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,EAAE;IACD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9C,OAAO,CACH,oBAAC,uBAAuB,IACpB,QAAQ,EAAE,QAAQ,EAClB,wBAAwB,EAAE,wBAAwB,EAClD,SAAS,EAAE,SAAS;QAEpB,oBAAC,qBAAqB,CAAC,QAAQ,IAC3B,KAAK,EAAE;gBACH,OAAO;gBACP,UAAU;aACb;YAED,oBAAC,sBAAsB,IAAC,WAAW,EAAE,WAAW;gBAC3C,QAAQ;gBACR,OAAO,IAAI,oBAAC,cAAc,OAAK,KAAK,GAAI,CACpB,CACI,CACX,CAC7B,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { CSSProperties, FC, MouseEvent } from "react";
|
|
2
|
-
export interface StatusButtonProps {
|
|
3
|
-
className?: string;
|
|
4
|
-
disabled?: boolean;
|
|
5
|
-
onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
6
|
-
style?: CSSProperties;
|
|
7
|
-
tabIndex?: number;
|
|
8
|
-
theme?: "light" | "dark";
|
|
9
|
-
}
|
|
10
|
-
export declare const CrossMintStatusButton: FC<StatusButtonProps>;
|
|
1
|
+
import { CSSProperties, FC, MouseEvent } from "react";
|
|
2
|
+
export interface StatusButtonProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
tabIndex?: number;
|
|
8
|
+
theme?: "light" | "dark";
|
|
9
|
+
}
|
|
10
|
+
export declare const CrossMintStatusButton: FC<StatusButtonProps>;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import React, { useMemo, useCallback } from "react";
|
|
2
|
-
import { OnboardingRequestStatusResponse, useCrossMintStatus } from "./useCrossMintStatus";
|
|
3
|
-
export const CrossMintStatusButton = ({ className, disabled, onClick, style, tabIndex, theme = "dark", ...props }) => {
|
|
4
|
-
const { status, clientId } = useCrossMintStatus();
|
|
5
|
-
const handleClick = useCallback((event) => {
|
|
6
|
-
if (onClick)
|
|
7
|
-
onClick(event);
|
|
8
|
-
if (status === OnboardingRequestStatusResponse.WAITING_SUBMISSION) {
|
|
9
|
-
window.open(`https://crossmint.io/developers/onboarding${clientId
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
}, [status]);
|
|
13
|
-
const content = useMemo(() => {
|
|
14
|
-
switch (status) {
|
|
15
|
-
case OnboardingRequestStatusResponse.INVALID:
|
|
16
|
-
return React.createElement("p", null, "Invalid clientId");
|
|
17
|
-
case OnboardingRequestStatusResponse.WAITING_SUBMISSION:
|
|
18
|
-
return React.createElement("p", null, "Click here to setup CrossMint");
|
|
19
|
-
case OnboardingRequestStatusResponse.PENDING:
|
|
20
|
-
return React.createElement("p", null, "Your application is under review");
|
|
21
|
-
case OnboardingRequestStatusResponse.ACCEPTED:
|
|
22
|
-
return React.createElement("p", null, "You're good to go!");
|
|
23
|
-
case OnboardingRequestStatusResponse.REJECTED:
|
|
24
|
-
return React.createElement("p", null, "You're application was rejected");
|
|
25
|
-
}
|
|
26
|
-
}, [status]);
|
|
27
|
-
return (React.createElement("button", { className: `client-sdk-button-trigger client-sdk-button-trigger-${theme}`, disabled: status !== OnboardingRequestStatusResponse.WAITING_SUBMISSION, onClick: handleClick, style: { ...style }, tabIndex: tabIndex, ...props },
|
|
28
|
-
React.createElement("img", { className: "client-sdk-button-icon", src: "https://www.crossmint.io/assets/crossmint/logo.png", alt: "Crossmint logo" }),
|
|
29
|
-
content));
|
|
30
|
-
};
|
|
1
|
+
import React, { useMemo, useCallback } from "react";
|
|
2
|
+
import { OnboardingRequestStatusResponse, useCrossMintStatus } from "./useCrossMintStatus";
|
|
3
|
+
export const CrossMintStatusButton = ({ className, disabled, onClick, style, tabIndex, theme = "dark", ...props }) => {
|
|
4
|
+
const { status, clientId, auctionId } = useCrossMintStatus();
|
|
5
|
+
const handleClick = useCallback((event) => {
|
|
6
|
+
if (onClick)
|
|
7
|
+
onClick(event);
|
|
8
|
+
if (status === OnboardingRequestStatusResponse.WAITING_SUBMISSION) {
|
|
9
|
+
window.open(`https://crossmint.io/developers/onboarding${clientId ? `?clientId=${clientId}` : ""}${auctionId ? `&auctionId=${auctionId}` : ""}`, "_blank");
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
}, [status]);
|
|
13
|
+
const content = useMemo(() => {
|
|
14
|
+
switch (status) {
|
|
15
|
+
case OnboardingRequestStatusResponse.INVALID:
|
|
16
|
+
return React.createElement("p", null, "Invalid clientId");
|
|
17
|
+
case OnboardingRequestStatusResponse.WAITING_SUBMISSION:
|
|
18
|
+
return React.createElement("p", null, "Click here to setup CrossMint");
|
|
19
|
+
case OnboardingRequestStatusResponse.PENDING:
|
|
20
|
+
return React.createElement("p", null, "Your application is under review");
|
|
21
|
+
case OnboardingRequestStatusResponse.ACCEPTED:
|
|
22
|
+
return React.createElement("p", null, "You're good to go!");
|
|
23
|
+
case OnboardingRequestStatusResponse.REJECTED:
|
|
24
|
+
return React.createElement("p", null, "You're application was rejected");
|
|
25
|
+
}
|
|
26
|
+
}, [status]);
|
|
27
|
+
return (React.createElement("button", { className: `client-sdk-button-trigger client-sdk-button-trigger-${theme}`, disabled: status !== OnboardingRequestStatusResponse.WAITING_SUBMISSION, onClick: handleClick, style: { ...style }, tabIndex: tabIndex, ...props },
|
|
28
|
+
React.createElement("img", { className: "client-sdk-button-icon", src: "https://www.crossmint.io/assets/crossmint/logo.png", alt: "Crossmint logo" }),
|
|
29
|
+
content));
|
|
30
|
+
};
|
|
31
31
|
//# sourceMappingURL=CrossMintStatusButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CrossMintStatusButton.js","sourceRoot":"","sources":["../../src/CrossMintStatusButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAoD,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACtG,OAAO,EAAE,+BAA+B,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAW3F,MAAM,CAAC,MAAM,qBAAqB,GAA0B,CAAC,EACzD,SAAS,EACT,QAAQ,EACR,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,GAAG,MAAM,EACd,GAAG,KAAK,EACX,EAAE,EAAE;IACD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,kBAAkB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"CrossMintStatusButton.js","sourceRoot":"","sources":["../../src/CrossMintStatusButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAoD,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACtG,OAAO,EAAE,+BAA+B,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAW3F,MAAM,CAAC,MAAM,qBAAqB,GAA0B,CAAC,EACzD,SAAS,EACT,QAAQ,EACR,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,GAAG,MAAM,EACd,GAAG,KAAK,EACX,EAAE,EAAE;IACD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAE7D,MAAM,WAAW,GAAyC,WAAW,CACjE,CAAC,KAAK,EAAE,EAAE;QACN,IAAI,OAAO;YAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAE5B,IAAI,MAAM,KAAK,+BAA+B,CAAC,kBAAkB,EAAE;YAC/D,MAAM,CAAC,IAAI,CACP,6CAA6C,QAAQ,CAAC,CAAC,CAAC,aAAa,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,GAChF,SAAS,CAAC,CAAC,CAAC,cAAc,SAAS,EAAE,CAAC,CAAC,CAAC,EAC5C,EAAE,EACF,QAAQ,CACX,CAAC;YACF,OAAO;SACV;IACL,CAAC,EACD,CAAC,MAAM,CAAC,CACX,CAAC;IAEF,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE;QACzB,QAAQ,MAAM,EAAE;YACZ,KAAK,+BAA+B,CAAC,OAAO;gBACxC,OAAO,kDAAuB,CAAC;YACnC,KAAK,+BAA+B,CAAC,kBAAkB;gBACnD,OAAO,+DAAoC,CAAC;YAChD,KAAK,+BAA+B,CAAC,OAAO;gBACxC,OAAO,kEAAuC,CAAC;YACnD,KAAK,+BAA+B,CAAC,QAAQ;gBACzC,OAAO,oDAAyB,CAAC;YACrC,KAAK,+BAA+B,CAAC,QAAQ;gBACzC,OAAO,iEAAsC,CAAC;SACrD;IACL,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO,CACH,gCACI,SAAS,EAAE,uDAAuD,KAAK,EAAE,EACzE,QAAQ,EAAE,MAAM,KAAK,+BAA+B,CAAC,kBAAkB,EACvE,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,EACnB,QAAQ,EAAE,QAAQ,KACd,KAAK;QAET,6BACI,SAAS,EAAC,wBAAwB,EAClC,GAAG,EAAC,oDAAoD,EACxD,GAAG,EAAC,gBAAgB,GACtB;QACD,OAAO,CACH,CACZ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { FC, ReactNode } from "react";
|
|
2
|
-
export interface CrossMintStatusProviderProps {
|
|
3
|
-
clientId: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
export interface CrossMintStatusProviderProps {
|
|
3
|
+
clientId: string;
|
|
4
|
+
auctionId?: string;
|
|
5
|
+
hideMintOnInactiveClient: boolean;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const CrossMintStatusProvider: FC<CrossMintStatusProviderProps>;
|
|
@@ -1,31 +1,36 @@
|
|
|
1
|
-
import React, { useEffect, useState } from "react";
|
|
2
|
-
import { OnboardingRequestStatusResponse, CrossMintStatusContext } from "./useCrossMintStatus";
|
|
3
|
-
export const CrossMintStatusProvider = ({ clientId, hideMintOnInactiveClient, children, }) => {
|
|
4
|
-
const [status, setStatus] = useState(OnboardingRequestStatusResponse.WAITING_SUBMISSION);
|
|
5
|
-
async function fetchClientIntegration() {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import { OnboardingRequestStatusResponse, CrossMintStatusContext } from "./useCrossMintStatus";
|
|
3
|
+
export const CrossMintStatusProvider = ({ clientId, auctionId, hideMintOnInactiveClient, children, }) => {
|
|
4
|
+
const [status, setStatus] = useState(OnboardingRequestStatusResponse.WAITING_SUBMISSION);
|
|
5
|
+
async function fetchClientIntegration() {
|
|
6
|
+
if (!clientId || clientId === "" || clientId === "<YOUR_CLIENT_ID>") {
|
|
7
|
+
console.warn("You must enter your own CrossMint client ID in <CrossMintProvider clientId=XXX>");
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const res = await fetch(`https://www.crossmint.io/api/crossmint/onboardingRequests/${clientId}/status`);
|
|
11
|
+
if (res.status === 200) {
|
|
12
|
+
const resData = await res.json();
|
|
13
|
+
console.log("resData", resData);
|
|
14
|
+
setStatus(resData.status);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
if (status !== OnboardingRequestStatusResponse.INVALID) {
|
|
18
|
+
setStatus(OnboardingRequestStatusResponse.INVALID);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
fetchClientIntegration();
|
|
24
|
+
const interval = setInterval(() => {
|
|
25
|
+
fetchClientIntegration();
|
|
26
|
+
}, 60 * 1000);
|
|
27
|
+
return () => clearInterval(interval);
|
|
28
|
+
}, []);
|
|
29
|
+
return (React.createElement(CrossMintStatusContext.Provider, { value: {
|
|
30
|
+
status,
|
|
31
|
+
clientId,
|
|
32
|
+
auctionId,
|
|
33
|
+
hideMintOnInactiveClient,
|
|
34
|
+
} }, children));
|
|
35
|
+
};
|
|
31
36
|
//# sourceMappingURL=CrossMintStatusProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CrossMintStatusProvider.js","sourceRoot":"","sources":["../../src/CrossMintStatusProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,+BAA+B,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"CrossMintStatusProvider.js","sourceRoot":"","sources":["../../src/CrossMintStatusProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,+BAA+B,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAS/F,MAAM,CAAC,MAAM,uBAAuB,GAAqC,CAAC,EACtE,QAAQ,EACR,SAAS,EACT,wBAAwB,EACxB,QAAQ,GACX,EAAE,EAAE;IACD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAChC,+BAA+B,CAAC,kBAAkB,CACrD,CAAC;IAEF,KAAK,UAAU,sBAAsB;QACjC,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,EAAE,IAAI,QAAQ,KAAK,kBAAkB,EAAE;YACjE,OAAO,CAAC,IAAI,CAAC,iFAAiF,CAAC,CAAC;YAChG,OAAO;SACV;QAED,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,6DAA6D,QAAQ,SAAS,CAAC,CAAC;QAExG,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE;YACpB,MAAM,OAAO,GAAkE,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;YAEhG,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAChC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;SAC7B;aAAM;YACH,IAAI,MAAM,KAAK,+BAA+B,CAAC,OAAO,EAAE;gBACpD,SAAS,CAAC,+BAA+B,CAAC,OAAO,CAAC,CAAC;aACtD;SACJ;IACL,CAAC;IAED,SAAS,CAAC,GAAG,EAAE;QACX,sBAAsB,EAAE,CAAC;QAEzB,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE;YAC9B,sBAAsB,EAAE,CAAC;QAC7B,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;QAEd,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACH,oBAAC,sBAAsB,CAAC,QAAQ,IAC5B,KAAK,EAAE;YACH,MAAM;YACN,QAAQ;YACR,SAAS;YACT,wBAAwB;SAC3B,IAEA,QAAQ,CACqB,CACrC,CAAC;AACN,CAAC,CAAC"}
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from "./CrossMintButton";
|
|
2
|
-
export * from "./CrossMintModal";
|
|
3
|
-
export * from "./useCrossMintModal";
|
|
4
|
-
export * from "./useCrossMintPopup";
|
|
5
|
-
export * from "./CrossMintProvider";
|
|
6
|
-
export * from "./useCrossMintStatus";
|
|
7
|
-
export * from "./CrossMintStatusButton";
|
|
1
|
+
export * from "./CrossMintButton";
|
|
2
|
+
export * from "./CrossMintModal";
|
|
3
|
+
export * from "./useCrossMintModal";
|
|
4
|
+
export * from "./useCrossMintPopup";
|
|
5
|
+
export * from "./CrossMintProvider";
|
|
6
|
+
export * from "./useCrossMintStatus";
|
|
7
|
+
export * from "./CrossMintStatusButton";
|
package/lib/esm/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from "./CrossMintButton";
|
|
2
|
-
export * from "./CrossMintModal";
|
|
3
|
-
export * from "./useCrossMintModal";
|
|
4
|
-
export * from "./useCrossMintPopup";
|
|
5
|
-
export * from "./CrossMintProvider";
|
|
6
|
-
export * from "./useCrossMintStatus";
|
|
7
|
-
export * from "./CrossMintStatusButton";
|
|
1
|
+
export * from "./CrossMintButton";
|
|
2
|
+
export * from "./CrossMintModal";
|
|
3
|
+
export * from "./useCrossMintModal";
|
|
4
|
+
export * from "./useCrossMintPopup";
|
|
5
|
+
export * from "./CrossMintProvider";
|
|
6
|
+
export * from "./useCrossMintStatus";
|
|
7
|
+
export * from "./CrossMintStatusButton";
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface CrossMintModalContextState {
|
|
3
|
-
visible: boolean;
|
|
4
|
-
setVisible: (open: boolean) => void;
|
|
5
|
-
}
|
|
6
|
-
export declare const CrossMintModalContext: import("react").Context<CrossMintModalContextState>;
|
|
7
|
-
export declare function useCrossMintModal(): CrossMintModalContextState;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface CrossMintModalContextState {
|
|
3
|
+
visible: boolean;
|
|
4
|
+
setVisible: (open: boolean) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const CrossMintModalContext: import("react").Context<CrossMintModalContextState>;
|
|
7
|
+
export declare function useCrossMintModal(): CrossMintModalContextState;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createContext, useContext } from "react";
|
|
2
|
-
export const CrossMintModalContext = createContext({});
|
|
3
|
-
export function useCrossMintModal() {
|
|
4
|
-
return useContext(CrossMintModalContext);
|
|
5
|
-
}
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
export const CrossMintModalContext = createContext({});
|
|
3
|
+
export function useCrossMintModal() {
|
|
4
|
+
return useContext(CrossMintModalContext);
|
|
5
|
+
}
|
|
6
6
|
//# sourceMappingURL=useCrossMintModal.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface PopupContextState {
|
|
3
|
-
connecting: boolean;
|
|
4
|
-
connect: (collectionTitle?: string, collectionDescription?: string, collectionPhoto?: string, mintTo?: string, emailTo?: string, listingId?: string) => void;
|
|
5
|
-
popup: Window | null;
|
|
6
|
-
}
|
|
7
|
-
export declare const PopupContext: import("react").Context<PopupContextState>;
|
|
8
|
-
export declare function useCrossMintPopup(): PopupContextState;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface PopupContextState {
|
|
3
|
+
connecting: boolean;
|
|
4
|
+
connect: (collectionTitle?: string, collectionDescription?: string, collectionPhoto?: string, mintTo?: string, emailTo?: string, listingId?: string) => void;
|
|
5
|
+
popup: Window | null;
|
|
6
|
+
}
|
|
7
|
+
export declare const PopupContext: import("react").Context<PopupContextState>;
|
|
8
|
+
export declare function useCrossMintPopup(): PopupContextState;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createContext, useContext } from "react";
|
|
2
|
-
export const PopupContext = createContext({});
|
|
3
|
-
export function useCrossMintPopup() {
|
|
4
|
-
return useContext(PopupContext);
|
|
5
|
-
}
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
export const PopupContext = createContext({});
|
|
3
|
+
export function useCrossMintPopup() {
|
|
4
|
+
return useContext(PopupContext);
|
|
5
|
+
}
|
|
6
6
|
//# sourceMappingURL=useCrossMintPopup.js.map
|