@ape.swap/bonds-sdk 2.7.2-test.1 → 2.7.2-test.3
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/main.js +8 -8
- package/dist/styles.css +11 -0
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -69257,7 +69257,7 @@ const styles$b = {
|
|
|
69257
69257
|
borderLeftColor: 'rgb(223 65 65 / 80%)',
|
|
69258
69258
|
transform: 'translateY(-50%)',
|
|
69259
69259
|
},
|
|
69260
|
-
}
|
|
69260
|
+
},
|
|
69261
69261
|
};
|
|
69262
69262
|
|
|
69263
69263
|
var domToImage = {exports: {}};
|
|
@@ -70178,23 +70178,23 @@ function checkImageExists(fileName) {
|
|
|
70178
70178
|
|
|
70179
70179
|
const LinkShare = ({ bondNFTData, userBill, }) => {
|
|
70180
70180
|
var _a, _b, _c, _d;
|
|
70181
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
70181
|
+
const [isLoading, setIsLoading] = useState([false, false]);
|
|
70182
70182
|
const [hideTag, setHideTag] = useState(false);
|
|
70183
70183
|
const mainUrl = useURLByEnvironment('mainUrl');
|
|
70184
70184
|
const apiUrl = (_a = useURLByEnvironment('apiV2')) !== null && _a !== void 0 ? _a : '';
|
|
70185
70185
|
const shareUrl = `${mainUrl}/bond-nft?bondAddress=${(_c = (_b = bondNFTData === null || bondNFTData === void 0 ? void 0 : bondNFTData.data) === null || _b === void 0 ? void 0 : _b.billNftAddress) === null || _c === void 0 ? void 0 : _c.toLowerCase()}%26bondChain=${bondNFTData === null || bondNFTData === void 0 ? void 0 : bondNFTData.chainId}%26tokenId=${userBill === null || userBill === void 0 ? void 0 : userBill.id}%26af=${(_d = bondNFTData === null || bondNFTData === void 0 ? void 0 : bondNFTData.data) === null || _d === void 0 ? void 0 : _d.createdAddressOwner}`;
|
|
70186
70186
|
const text = `I've filled my bags with $${userBill === null || userBill === void 0 ? void 0 : userBill.bond.earnToken.symbol} at a discount, thanks to Bonds-only on @apebond! Check it out: `;
|
|
70187
|
-
const handleShare = (url) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
70188
|
-
if (isLoading)
|
|
70187
|
+
const handleShare = (url, social) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
70188
|
+
if (isLoading[0] || isLoading[1])
|
|
70189
70189
|
return;
|
|
70190
|
-
setIsLoading(true);
|
|
70190
|
+
setIsLoading(social === 'x' ? [true, false] : [false, true]);
|
|
70191
70191
|
yield generateImageFromTemplate(bondNFTData, url, apiUrl);
|
|
70192
|
-
setIsLoading(false);
|
|
70192
|
+
setIsLoading([false, false]);
|
|
70193
70193
|
});
|
|
70194
70194
|
useEffect(() => {
|
|
70195
70195
|
setTimeout(() => setHideTag(true), 10000);
|
|
70196
70196
|
}, []);
|
|
70197
|
-
return (jsx$2(Flex$1, { sx: styles$b.containerLinksShare, children: bondNFTData && bondNFTData.data && (jsxs(Fragment$1, { children: [
|
|
70197
|
+
return (jsx$2(Flex$1, { sx: styles$b.containerLinksShare, children: bondNFTData && bondNFTData.data && (jsxs(Fragment$1, { children: [jsx$2(Link, { href: "https://app.fuul.xyz/incentives/apebond", target: "_blank", className: `fade-out ${hideTag ? 'hidden' : ''}`, children: jsx$2(Flex$1, { sx: styles$b.tagShareBond, children: "Share your Bonds and earn rewards!" }) }), jsx$2(Flex$1, { sx: styles$b.linkShareButton, onClick: () => handleShare(`https://twitter.com/intent/tweet?text=${text}&url=${shareUrl}`, 'x'), children: isLoading[0] ? jsx$2(Spinner, { size: 16 }) : jsx$2(Svg, { icon: "twitter", width: 24 }) }), jsx$2(Flex$1, { sx: styles$b.linkShareButton, onClick: () => handleShare(`https://warpcast.com/~/compose?text=${text}&embeds[]=${shareUrl}`, 'farcaster'), children: isLoading[1] ? jsx$2(Spinner, { size: 16 }) : jsx$2(Svg, { icon: "Farcaster", width: 16 }) })] })) }));
|
|
70198
70198
|
};
|
|
70199
70199
|
|
|
70200
70200
|
const YourBondsModal = ({ onDismiss, userBill }) => {
|
|
@@ -70272,7 +70272,7 @@ const YourBondsModal = ({ onDismiss, userBill }) => {
|
|
|
70272
70272
|
justifyContent: 'center',
|
|
70273
70273
|
alignItems: 'center',
|
|
70274
70274
|
zIndex: 1,
|
|
70275
|
-
}, children: jsx$2(Spinner, { width: 100 }) })), jsx$2(LinkShare, { bondNFTData: bondNFTData, userBill: userBill })] }), jsxs(Flex$1, { className: "yourbondsmodal yourbondinfo", children: [jsxs(Flex$1, { className: "yourbondinfo title-container", children: [jsx$2(Flex$1, { className: "title-container bondicon", children: userBill && (jsx$2(TokenImage, { symbol: (_k = (_j = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _j === void 0 ? void 0 : _j.showcaseTokenName) !== null && _k !== void 0 ? _k : (_m = (_l = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _l === void 0 ? void 0 : _l.earnToken) === null || _m === void 0 ? void 0 : _m.symbol, size: 40, chain: userBill === null || userBill === void 0 ? void 0 : userBill.bond.chainId })) }), jsx$2(Flex$1, { className: "title-container tokenname", children: (_p = (_o = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _o === void 0 ? void 0 : _o.showcaseTokenName) !== null && _p !== void 0 ? _p : userBill === null || userBill === void 0 ? void 0 : userBill.bond.earnToken.symbol }), jsx$2(Flex$1, { className: "title-container tokentags", children: (_r = (_q = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _q === void 0 ? void 0 : _q.tags) === null || _r === void 0 ? void 0 : _r.slice(0, 1).map((tag) => {
|
|
70275
|
+
}, children: jsx$2(Spinner, { width: 100 }) })), imgLoaded && jsx$2(LinkShare, { bondNFTData: bondNFTData, userBill: userBill })] }), jsxs(Flex$1, { className: "yourbondsmodal yourbondinfo", children: [jsxs(Flex$1, { className: "yourbondinfo title-container", children: [jsx$2(Flex$1, { className: "title-container bondicon", children: userBill && (jsx$2(TokenImage, { symbol: (_k = (_j = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _j === void 0 ? void 0 : _j.showcaseTokenName) !== null && _k !== void 0 ? _k : (_m = (_l = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _l === void 0 ? void 0 : _l.earnToken) === null || _m === void 0 ? void 0 : _m.symbol, size: 40, chain: userBill === null || userBill === void 0 ? void 0 : userBill.bond.chainId })) }), jsx$2(Flex$1, { className: "title-container tokenname", children: (_p = (_o = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _o === void 0 ? void 0 : _o.showcaseTokenName) !== null && _p !== void 0 ? _p : userBill === null || userBill === void 0 ? void 0 : userBill.bond.earnToken.symbol }), jsx$2(Flex$1, { className: "title-container tokentags", children: (_r = (_q = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _q === void 0 ? void 0 : _q.tags) === null || _r === void 0 ? void 0 : _r.slice(0, 1).map((tag) => {
|
|
70276
70276
|
return (jsx$2(Flex$1, { sx: { marginRight: '10px' }, children: jsx$2(ListTag, { text: tag === null || tag === void 0 ? void 0 : tag.toUpperCase() }) }, tag));
|
|
70277
70277
|
}) }), jsxs(Text, { sx: { color: 'text', opacity: '0.6', fontSize: ['12px', '12px', '12px', '16px'] }, children: ["#", userBill === null || userBill === void 0 ? void 0 : userBill.id] })] }), jsxs(Flex$1, { className: "yourbondinfo blocks-container", children: [jsxs(Flex$1, { className: "attributes-container", children: [jsxs(Flex$1, { className: "attributes-header", sx: {
|
|
70278
70278
|
borderRadius: `${isOpenTraits ? '6px 6px 0px 0px' : 'normal'}`,
|
package/dist/styles.css
CHANGED
|
@@ -1392,6 +1392,17 @@ span.flex-inline {
|
|
|
1392
1392
|
opacity: 0;
|
|
1393
1393
|
}
|
|
1394
1394
|
}
|
|
1395
|
+
.fade-out {
|
|
1396
|
+
opacity: 1;
|
|
1397
|
+
visibility: visible;
|
|
1398
|
+
transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
.fade-out.hidden {
|
|
1402
|
+
opacity: 0;
|
|
1403
|
+
visibility: hidden;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1395
1406
|
.yourbondsmodal-backdrop {
|
|
1396
1407
|
position: fixed;
|
|
1397
1408
|
top: 0;
|