@ape.swap/bonds-sdk 1.1.0-test.43 → 1.1.0-test.44
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.
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { BondsData } from '../../types/bonds';
|
|
2
2
|
import '../../scss/BondRowsByChain.scss';
|
|
3
|
-
declare const BondRowsByChain: ({ bonds, hotBonds, hideTitles, chains, }: {
|
|
3
|
+
declare const BondRowsByChain: ({ bonds, hotBonds, hideTitles, chains, modalVariant }: {
|
|
4
4
|
bonds: BondsData[];
|
|
5
5
|
hotBonds?: string[];
|
|
6
6
|
hideTitles: boolean;
|
|
7
7
|
chains?: number[];
|
|
8
|
+
modalVariant?: "standard" | "alt";
|
|
8
9
|
}) => import("react").JSX.Element;
|
|
9
10
|
export default BondRowsByChain;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { BondsData } from '../../types/bonds';
|
|
2
2
|
import '../../scss/BondRowsWithTitle.scss';
|
|
3
|
-
declare const BondRowsWithTitle: ({ chain, bonds, hotBonds, hideTitles, }: {
|
|
3
|
+
declare const BondRowsWithTitle: ({ chain, bonds, hotBonds, hideTitles, modalVariant }: {
|
|
4
4
|
chain: number;
|
|
5
5
|
bonds: BondsData[];
|
|
6
6
|
hotBonds?: string[];
|
|
7
7
|
hideTitles: boolean;
|
|
8
|
+
modalVariant?: "standard" | "alt";
|
|
8
9
|
}) => import("react").JSX.Element;
|
|
9
10
|
export default BondRowsWithTitle;
|
package/dist/main.js
CHANGED
|
@@ -72359,10 +72359,10 @@ const BondModal = ({ bondAddress, bondChain, accordionTitle = 'What are Bonds?',
|
|
|
72359
72359
|
) }))] }));
|
|
72360
72360
|
};
|
|
72361
72361
|
|
|
72362
|
-
const BondRow = ({ bond, hotBonds }) => {
|
|
72362
|
+
const BondRow = ({ bond, hotBonds, modalVariant }) => {
|
|
72363
72363
|
var _a, _b, _c;
|
|
72364
72364
|
// Modal
|
|
72365
|
-
const [openBuyModal] = useModal(jsx$2(BondModal, { bondAddress: bond.billAddress, bondChain: bond.chainId }), true, true, `buyBondModal-${bond.billAddress}-${bond.chainId}`);
|
|
72365
|
+
const [openBuyModal] = useModal(jsx$2(BondModal, { bondAddress: bond.billAddress, bondChain: bond.chainId, variant: modalVariant }), true, true, `buyBondModal-${bond.billAddress}-${bond.chainId}`);
|
|
72366
72366
|
const handleOpenModal = () => {
|
|
72367
72367
|
openBuyModal();
|
|
72368
72368
|
if (typeof window !== 'undefined') {
|
|
@@ -72415,7 +72415,7 @@ const BondRow = ({ bond, hotBonds }) => {
|
|
|
72415
72415
|
})})` }) }), jsx$2(Flex$1, { className: "column column-hotbond", children: jsx$2(Flex$1, { className: "column column-icon", children: (hotBonds === null || hotBonds === void 0 ? void 0 : hotBonds.includes(bond.billAddress.toLowerCase())) && ((_c = bond.discount) !== null && _c !== void 0 ? _c : 0) > 0 && (jsx$2(Svg, { icon: "hot", width: "20px" })) }) })] })] }, bond.billAddress));
|
|
72416
72416
|
};
|
|
72417
72417
|
|
|
72418
|
-
const BondRowsWithTitle = ({ chain, bonds, hotBonds, hideTitles, }) => {
|
|
72418
|
+
const BondRowsWithTitle = ({ chain, bonds, hotBonds, hideTitles, modalVariant }) => {
|
|
72419
72419
|
const billsFilteredByChain = bonds.filter((bill) => bill.chainId === chain);
|
|
72420
72420
|
const key = chain;
|
|
72421
72421
|
const [isOpen, setIsOpen] = useState(true);
|
|
@@ -72425,13 +72425,13 @@ const BondRowsWithTitle = ({ chain, bonds, hotBonds, hideTitles, }) => {
|
|
|
72425
72425
|
width: '100%',
|
|
72426
72426
|
marginTop: '0px',
|
|
72427
72427
|
}, children: billsFilteredByChain === null || billsFilteredByChain === void 0 ? void 0 : billsFilteredByChain.map((bond) => {
|
|
72428
|
-
return jsx$2(BondRow, { bond: bond, hotBonds: hotBonds }, bond.billAddress);
|
|
72428
|
+
return jsx$2(BondRow, { bond: bond, hotBonds: hotBonds, modalVariant: modalVariant }, bond.billAddress);
|
|
72429
72429
|
}) }, key))] }) }, key));
|
|
72430
72430
|
};
|
|
72431
72431
|
|
|
72432
|
-
const BondRowsByChain = ({ bonds, hotBonds, hideTitles, chains, }) => {
|
|
72432
|
+
const BondRowsByChain = ({ bonds, hotBonds, hideTitles, chains, modalVariant }) => {
|
|
72433
72433
|
return (jsx$2(Flex$1, { className: "bondrowsbychain", children: MAINNET_CHAINS.map((chain, index) => {
|
|
72434
|
-
return ((!chains || chains.length === 0 || chains.includes(chain)) && (jsx$2(BondRowsWithTitle, { chain: chain, bonds: bonds, hotBonds: hotBonds, hideTitles: hideTitles }, chain)));
|
|
72434
|
+
return ((!chains || chains.length === 0 || chains.includes(chain)) && (jsx$2(BondRowsWithTitle, { chain: chain, bonds: bonds, hotBonds: hotBonds, hideTitles: hideTitles, modalVariant: modalVariant }, chain)));
|
|
72435
72435
|
}) }));
|
|
72436
72436
|
};
|
|
72437
72437
|
|
|
@@ -72584,7 +72584,7 @@ const CheckUrl = () => {
|
|
|
72584
72584
|
return jsx$2(Fragment$1, {});
|
|
72585
72585
|
};
|
|
72586
72586
|
|
|
72587
|
-
const Bonds = ({ chains = [] }) => {
|
|
72587
|
+
const Bonds = ({ chains = [], modalVariant = 'standard' }) => {
|
|
72588
72588
|
// Fetch data
|
|
72589
72589
|
const { data: bondData } = useBondsData();
|
|
72590
72590
|
const { data: hotBonds } = useHotBonds();
|
|
@@ -72631,7 +72631,7 @@ const Bonds = ({ chains = [] }) => {
|
|
|
72631
72631
|
const handleChangeFilterOption = useCallback((newOption) => {
|
|
72632
72632
|
setFilterOption(newOption);
|
|
72633
72633
|
}, []);
|
|
72634
|
-
return (jsxs(Flex$1, { className: "bonds-container table-container", children: [jsx$2(CheckUrl, {}), jsx$2(BondRowHeader, { searchQuery: searchQuery, setSearchQuery: setSearchQuery, setChainFilterOption: setChainFilterOption, chainFilterOption: chainFilterOption !== null && chainFilterOption !== void 0 ? chainFilterOption : ['All Chains'], filterOptions: filterOptions, filterOption: filterOption, setFilterOption: handleChangeFilterOption, onSort: handleSortOptions }), (billsToRender === null || billsToRender === void 0 ? void 0 : billsToRender.length) > 0 ? (jsx$2(BondRowsByChain, { chains: chains, bonds: billsToRender, hotBonds: hotBonds, hideTitles: searchQuery !== '' })) : searchQuery ? (jsx$2(Fragment$1, { children: "No results" })) : (jsx$2(Flex$1, { className: "bonds-spinner", children: jsx$2(Spinner, { size: 100 }) }))] }));
|
|
72634
|
+
return (jsxs(Flex$1, { className: "bonds-container table-container", children: [jsx$2(CheckUrl, {}), jsx$2(BondRowHeader, { searchQuery: searchQuery, setSearchQuery: setSearchQuery, setChainFilterOption: setChainFilterOption, chainFilterOption: chainFilterOption !== null && chainFilterOption !== void 0 ? chainFilterOption : ['All Chains'], filterOptions: filterOptions, filterOption: filterOption, setFilterOption: handleChangeFilterOption, onSort: handleSortOptions }), (billsToRender === null || billsToRender === void 0 ? void 0 : billsToRender.length) > 0 ? (jsx$2(BondRowsByChain, { chains: chains, bonds: billsToRender, hotBonds: hotBonds, hideTitles: searchQuery !== '', modalVariant: modalVariant })) : searchQuery ? (jsx$2(Fragment$1, { children: "No results" })) : (jsx$2(Flex$1, { className: "bonds-spinner", children: jsx$2(Spinner, { size: 100 }) }))] }));
|
|
72635
72635
|
};
|
|
72636
72636
|
|
|
72637
72637
|
var BondsViewOptions;
|