@ape.swap/bonds-sdk 1.0.455 → 1.0.457

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,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import { BondsDataResponse } from '../../types/bonds';
3
- declare const BondRowsByChain: ({ bonds, hotBonds, rowClick }: {
3
+ declare const BondRowsByChain: ({ bonds, hotBonds, hideTitles, rowClick }: {
4
4
  bonds: BondsDataResponse[];
5
5
  hotBonds?: string[] | undefined;
6
+ hideTitles: boolean;
6
7
  rowClick: (bond: BondsDataResponse) => void;
7
8
  }) => React.JSX.Element;
8
9
  export default BondRowsByChain;
@@ -15,13 +15,13 @@ import { ChainId } from '../../enum/apeswaplists';
15
15
  import { Flex } from '../uikit-sdk';
16
16
  import { MAINNET_CHAINS } from '../../config/constants/chains';
17
17
  var BondRowsByChain = function (_a) {
18
- var bonds = _a.bonds, hotBonds = _a.hotBonds, rowClick = _a.rowClick;
18
+ var bonds = _a.bonds, hotBonds = _a.hotBonds, hideTitles = _a.hideTitles, rowClick = _a.rowClick;
19
19
  return (_jsxs(Flex, __assign({ sx: { width: '100%', flexDirection: 'column', mt: '5px' } }, { children: [[ChainId.MAINNET].map(function (chain, index) {
20
- return (_jsx(BondRowsWithTitle, { chain: chain, bonds: bonds, hotBonds: hotBonds, rowClick: rowClick }, chain));
20
+ return (_jsx(BondRowsWithTitle, { chain: chain, bonds: bonds, hotBonds: hotBonds, hideTitles: hideTitles, rowClick: rowClick }, chain));
21
21
  }), [ChainId.BSC].map(function (chain, index) {
22
- return (_jsx(BondRowsWithTitle, { chain: chain, bonds: bonds, hotBonds: hotBonds, rowClick: rowClick }, chain));
22
+ return (_jsx(BondRowsWithTitle, { chain: chain, bonds: bonds, hotBonds: hotBonds, hideTitles: hideTitles, rowClick: rowClick }, chain));
23
23
  }), (MAINNET_CHAINS.slice(2, MAINNET_CHAINS.length).map(function (chain, index) {
24
- return (_jsx(BondRowsWithTitle, { chain: chain, bonds: bonds, rowClick: rowClick }, chain));
24
+ return (_jsx(BondRowsWithTitle, { chain: chain, bonds: bonds, hotBonds: hotBonds, hideTitles: hideTitles, rowClick: rowClick }, chain));
25
25
  }))] })));
26
26
  };
27
27
  export default BondRowsByChain;
@@ -1,9 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { BondsDataResponse } from "../../types/bonds";
3
- declare const BondRowsWithTitle: ({ chain, bonds, hotBonds, rowClick, }: {
3
+ declare const BondRowsWithTitle: ({ chain, bonds, hotBonds, hideTitles, rowClick, }: {
4
4
  chain: number;
5
5
  bonds: BondsDataResponse[];
6
6
  hotBonds?: string[] | undefined;
7
+ hideTitles: boolean;
7
8
  rowClick: (bond: BondsDataResponse) => void;
8
9
  }) => import("react").JSX.Element;
9
10
  export default BondRowsWithTitle;
@@ -16,11 +16,11 @@ import BondRow from "./BondRow";
16
16
  import { useState } from "react";
17
17
  import { Flex } from "../uikit-sdk";
18
18
  var BondRowsWithTitle = function (_a) {
19
- var chain = _a.chain, bonds = _a.bonds, hotBonds = _a.hotBonds, rowClick = _a.rowClick;
19
+ var chain = _a.chain, bonds = _a.bonds, hotBonds = _a.hotBonds, hideTitles = _a.hideTitles, rowClick = _a.rowClick;
20
20
  var billsFilteredByChain = bonds.filter(function (bill) { return bill.chainId === chain; });
21
21
  var key = chain;
22
22
  var _b = useState(true), isOpen = _b[0], setIsOpen = _b[1];
23
- return (_jsx(Flex, __assign({ sx: { width: '100%', flexDirection: 'column' } }, { children: _jsxs(AnimatePresence, __assign({ initial: false }, { children: [_jsx(Flex, __assign({ onClick: function () { return setIsOpen(!isOpen); } }, { children: _jsx(ChainTitle, { chain: chain, pt: '5px', isOpen: isOpen }) })), billsFilteredByChain.length > 0 && isOpen && (_jsx(motion.div, __assign({ initial: { height: 0, overflow: 'hidden' }, animate: { height: 'fit-content', overflow: 'hidden', transitionEnd: { overflow: 'visible' } }, exit: { height: 0, overflow: 'hidden' }, sx: {
23
+ return (_jsx(Flex, __assign({ sx: { width: '100%', flexDirection: 'column' } }, { children: _jsxs(AnimatePresence, __assign({ initial: false }, { children: [_jsx(Flex, __assign({ onClick: function () { return setIsOpen(!isOpen); } }, { children: _jsx(ChainTitle, { chain: chain, pt: '5px', hideTitles: hideTitles, isOpen: isOpen }) })), billsFilteredByChain.length > 0 && isOpen && (_jsx(motion.div, __assign({ initial: { height: 0, overflow: 'hidden' }, animate: { height: 'fit-content', overflow: 'hidden', transitionEnd: { overflow: 'visible' } }, exit: { height: 0, overflow: 'hidden' }, sx: {
24
24
  position: 'relative',
25
25
  overflow: 'hidden',
26
26
  width: '100%',
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
- declare const ChainTitle: ({ chain, pt, isOpen, }: {
2
+ declare const ChainTitle: ({ chain, pt, hideTitles, isOpen, }: {
3
3
  chain: number;
4
4
  pt: string;
5
+ hideTitles?: boolean | undefined;
5
6
  isOpen: boolean;
6
7
  }) => React.JSX.Element;
7
8
  export default ChainTitle;
@@ -13,7 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
13
13
  import { Flex, Svg } from '../uikit-sdk';
14
14
  import { NETWORK_LABEL } from '../../config/constants/chains';
15
15
  var ChainTitle = function (_a) {
16
- var chain = _a.chain, pt = _a.pt, isOpen = _a.isOpen;
16
+ var chain = _a.chain, pt = _a.pt, hideTitles = _a.hideTitles, isOpen = _a.isOpen;
17
17
  return (_jsxs(Flex, __assign({ sx: {
18
18
  pt: pt,
19
19
  pb: '10px',
@@ -22,7 +22,7 @@ var ChainTitle = function (_a) {
22
22
  fontWeight: 500,
23
23
  cursor: 'pointer',
24
24
  textTransform: 'uppercase',
25
- display: 'flex',
25
+ display: hideTitles ? 'none' : 'flex',
26
26
  width: '200px',
27
27
  } }, { children: [NETWORK_LABEL[chain], " Bonds", _jsx(Flex, __assign({ sx: { ml: '7px' } }, { children: _jsx(Svg, { icon: "caret", direction: isOpen ? 'down' : 'up', width: 8, color: "textDisabledButton" }) }))] })));
28
28
  };
@@ -267,6 +267,6 @@ var Bonds = function (_a) {
267
267
  setBondsRendered(true);
268
268
  }
269
269
  }, [filteredBonds]);
270
- return (_jsxs(ThemeUIProvider, __assign({ theme: defaultTheme }, { children: [isActive && account && _jsx("p", { children: account }), isActive && account && _jsx("button", __assign({ onClick: handleApprove }, { children: "Approve USDT" })), bondsRendered && (_jsxs(Flex, __assign({ className: "container table-container" }, { children: [_jsx(BondRowHeader, { inputValue: inputValue, onInputChange: handleInputChange, onSort: handleSort }), _jsx(BondRowsByChain, { bonds: filteredBonds, hotBonds: hotBonds, rowClick: rowClick })] })))] })));
270
+ return (_jsxs(ThemeUIProvider, __assign({ theme: defaultTheme }, { children: [isActive && account && _jsx("p", { children: account }), isActive && account && _jsx("button", __assign({ onClick: handleApprove }, { children: "Approve USDT" })), bondsRendered && (_jsxs(Flex, __assign({ className: "container table-container" }, { children: [_jsx(BondRowHeader, { inputValue: inputValue, onInputChange: handleInputChange, onSort: handleSort }), _jsx(BondRowsByChain, { bonds: filteredBonds, hotBonds: hotBonds, hideTitles: inputValue !== '', rowClick: rowClick })] })))] })));
271
271
  };
272
272
  export default Bonds;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Ape Bond SDK",
4
4
  "author": "Ape Bond",
5
5
  "license": "MIT",
6
- "version": "1.0.455",
6
+ "version": "1.0.457",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",