@ape.swap/bonds-sdk 2.5.2-test4 → 2.5.2-test6
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
CHANGED
|
@@ -74218,8 +74218,9 @@ const RestrictedRegionModal = ({ onDismiss }) => {
|
|
|
74218
74218
|
return (jsxs(Modal, { className: "modal", title: "Notice", sx: { maxWidth: '200px' }, children: [jsxs(Flex, { sx: { my: '20px' }, children: ["Unfortunately, this bond is restricted for your region: ", geoData === null || geoData === void 0 ? void 0 : geoData.countryCode, "."] }), jsx$2(Button, { fullWidth: true, onClick: onDismiss, children: "Close" })] }));
|
|
74219
74219
|
};
|
|
74220
74220
|
|
|
74221
|
-
const NoBonusModal = ({ onAcknowledge }) => {
|
|
74221
|
+
const NoBonusModal = ({ onAcknowledge, showcaseTokenName }) => {
|
|
74222
74222
|
const [isOpen, setIsOpen] = useState(true);
|
|
74223
|
+
const [isChecked, setIsChecked] = useState(false);
|
|
74223
74224
|
const handleAcknowledge = () => {
|
|
74224
74225
|
onAcknowledge();
|
|
74225
74226
|
setIsOpen(false);
|
|
@@ -74227,7 +74228,10 @@ const NoBonusModal = ({ onAcknowledge }) => {
|
|
|
74227
74228
|
const handleCancel = () => {
|
|
74228
74229
|
setIsOpen(false);
|
|
74229
74230
|
};
|
|
74230
|
-
|
|
74231
|
+
const handleCheckboxChange = () => {
|
|
74232
|
+
setIsChecked(!isChecked);
|
|
74233
|
+
};
|
|
74234
|
+
return (isOpen && (jsxs(Modal, { className: "nobonus-modal", title: "Warning", onClose: handleAcknowledge, children: [jsxs("p", { children: ["You're buying ", showcaseTokenName, " at a higher price than the market, which will result in receiving fewer tokens compared to swapping via an exchange."] }), jsx$2("p", { children: "You will not receive any bonus tokens when buying this bond." }), jsxs(Flex, { className: "nobonus-checkbox-row", sx: { flexDirection: 'row', gap: '8px', pb: '20px' }, children: [jsx$2(Flex, { className: "nobonus-checkbox", children: jsx$2(Checkbox, { onChange: handleCheckboxChange }) }), jsx$2(Flex, { className: "nobonus-checkbox-text", children: "I understand and want to proceed." })] }), jsxs(Flex, { className: "nobonus-actions", sx: { flexDirection: 'row', gap: '8px' }, children: [jsx$2(Button, { classname: "nobonus-cancel", onClick: handleCancel, sx: { width: '100%', justifyContent: 'center' }, variant: "secondary", children: "Cancel" }), jsx$2(Button, { className: "nobonus-buy", onClick: handleAcknowledge, disabled: !isChecked, sx: { width: '100%', justifyContent: 'center' }, children: "Buy" })] })] })));
|
|
74231
74235
|
};
|
|
74232
74236
|
|
|
74233
74237
|
const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) => {
|
|
@@ -74423,7 +74427,7 @@ const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) =
|
|
|
74423
74427
|
}
|
|
74424
74428
|
}
|
|
74425
74429
|
};
|
|
74426
|
-
const [openNoBonusModal] = useModal(jsx$2(NoBonusModal, { onAcknowledge: handleBothPurchases }), true, true);
|
|
74430
|
+
const [openNoBonusModal] = useModal(jsx$2(NoBonusModal, { onAcknowledge: handleBothPurchases, showcaseTokenName: bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName }), true, true);
|
|
74427
74431
|
const handleOpenModal = () => {
|
|
74428
74432
|
var _a;
|
|
74429
74433
|
if ((_a = bondData === null || bondData === void 0 ? void 0 : bondData.bonus) !== null && _a !== void 0 ? _a : 0 < 0) {
|