@ape.swap/bonds-sdk 1.0.534 → 1.0.536
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.
|
@@ -13,12 +13,6 @@ var BondMenu = function (_a) {
|
|
|
13
13
|
value: filter,
|
|
14
14
|
};
|
|
15
15
|
});
|
|
16
|
-
var push = function (url) {
|
|
17
|
-
window.location.assign(url);
|
|
18
|
-
};
|
|
19
|
-
var replace = function (url) {
|
|
20
|
-
window.location.replace(url);
|
|
21
|
-
};
|
|
22
16
|
var asPath = window.location.pathname + window.location.search;
|
|
23
17
|
var handleFilterSelection = useCallback(function (newOption) {
|
|
24
18
|
setChainFilterOption(['All Chains']);
|
|
@@ -8,6 +8,7 @@ interface BondRowHeaderProps {
|
|
|
8
8
|
filterOptions: string[];
|
|
9
9
|
filterOption: string;
|
|
10
10
|
setFilterOption: (newOption: string) => void;
|
|
11
|
+
onInputChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
12
|
onHandleQueryChange: (value: string) => void;
|
|
12
13
|
onSort: (key: 'discount' | 'arr' | 'terms' | 'tokensRemaining') => void;
|
|
13
14
|
}
|
|
@@ -6,7 +6,7 @@ import { TooltipText } from '../../enum/tooltips';
|
|
|
6
6
|
import '../../scss/BondRowHeader.scss';
|
|
7
7
|
import BondMenu from '../BondMenu/BondMenu';
|
|
8
8
|
var BondRowHeader = function (_a) {
|
|
9
|
-
var inputValue = _a.inputValue, setChainFilterOption = _a.setChainFilterOption, chainFilterOption = _a.chainFilterOption, filterOptions = _a.filterOptions, filterOption = _a.filterOption, setFilterOption = _a.setFilterOption, onHandleQueryChange = _a.onHandleQueryChange, onSort = _a.onSort;
|
|
10
|
-
return (_jsxs(Flex, { className: "header-container", children: [_jsx(Flex, { className: "header-container filters", children: _jsx(BondMenu, { chainFilterOption: chainFilterOption !== null && chainFilterOption !== void 0 ? chainFilterOption : ['All Chains'], setChainFilterOption: setChainFilterOption, filterOptions: filterOptions, filterOption: filterOption, setFilterOption: setFilterOption, onHandleQueryChange: onHandleQueryChange }) }), _jsxs(Flex, { className: "header-container rows", children: [_jsxs(Flex, { className: "column column-tokens", children: [_jsx(Flex, { className: "column column-search", sx: { width: '100%', maxWidth: ['200px', '200px', '200px', '340px'] }, children: _jsx(Input, { value: inputValue, onChange:
|
|
9
|
+
var inputValue = _a.inputValue, setChainFilterOption = _a.setChainFilterOption, chainFilterOption = _a.chainFilterOption, filterOptions = _a.filterOptions, filterOption = _a.filterOption, setFilterOption = _a.setFilterOption, onInputChange = _a.onInputChange, onHandleQueryChange = _a.onHandleQueryChange, onSort = _a.onSort;
|
|
10
|
+
return (_jsxs(Flex, { className: "header-container", children: [_jsx(Flex, { className: "header-container filters", children: _jsx(BondMenu, { chainFilterOption: chainFilterOption !== null && chainFilterOption !== void 0 ? chainFilterOption : ['All Chains'], setChainFilterOption: setChainFilterOption, filterOptions: filterOptions, filterOption: filterOption, setFilterOption: setFilterOption, onHandleQueryChange: onHandleQueryChange }) }), _jsxs(Flex, { className: "header-container rows", children: [_jsxs(Flex, { className: "column column-tokens", children: [_jsx(Flex, { className: "column column-search", sx: { width: '100%', maxWidth: ['200px', '200px', '200px', '340px'] }, children: _jsx(Input, { value: inputValue, onChange: onInputChange, variant: "search", sx: { fontWeight: 400, background: 'white2', height: '30px', fontSize: '14px', color: 'white' }, width: '100%', placeholder: 'Search...' }) }), _jsx(Flex, { className: "column column-tokenicons" })] }), _jsxs(Flex, { className: "column column-bondinfo", children: [_jsxs(Flex, { className: "column column-discount", children: [_jsx(Flex, { className: "column tooltip", children: _jsxs(TooltipBubble, { body: _jsx(Flex, { children: TooltipText.Discount }), width: "230px", placement: "bottomLeft", transformTip: "translate(18%, -4%)", children: ["DISCOUNT", _jsx(Flex, { className: "column header-icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px", color: "textDisabledButton" }) })] }) }), _jsx(Flex, { className: "column header-icon", onClick: function () { return onSort('discount'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsxs(Flex, { className: "column column-arr", children: [_jsx(Flex, { className: "column tooltip", children: _jsxs(TooltipBubble, { body: _jsx(Flex, { children: TooltipText.ARR }), width: "230px", placement: "bottomLeft", transformTip: "translate(8%, -5%)", children: ["ARR", _jsx(Flex, { className: "column header-icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px", color: "textDisabledButton" }) })] }) }), _jsx(Flex, { className: "column header-icon", onClick: function () { return onSort('arr'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsxs(Flex, { className: "column column-terms", children: [_jsx(Flex, { className: "column tooltip", children: _jsxs(TooltipBubble, { body: _jsx(Flex, { children: TooltipText.Terms }), width: "230px", placement: "bottomRight", transformTip: "translate(11%, -5%)", children: ["TERMS", _jsx(Flex, { className: "column header-icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px", color: "textDisabledButton" }) })] }) }), _jsx(Flex, { className: "column header-icon", onClick: function () { return onSort('terms'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsxs(Flex, { className: "column column-tokensremaining", children: [_jsx(Flex, { className: "column tooltip", children: _jsxs(TooltipBubble, { body: _jsx(Flex, { children: TooltipText.TokensRemaining }), width: "230px", placement: "bottomRight", transformTip: "translate(12%, -4%)", children: ["TOKENS REMAINING", _jsx(Flex, { className: "column header-icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px", color: "textDisabledButton" }) })] }) }), _jsx(Flex, { className: "column header-icon", onClick: function () { return onSort('tokensRemaining'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsx(Flex, { className: "column column-hotbond" })] })] })] }));
|
|
11
11
|
};
|
|
12
12
|
export default BondRowHeader;
|
|
@@ -216,10 +216,6 @@ var Bonds = function (_a) {
|
|
|
216
216
|
};
|
|
217
217
|
// Search logic
|
|
218
218
|
var _j = useState(''), inputValue = _j[0], setInputValue = _j[1];
|
|
219
|
-
var handleChangeQuery = useCallback(function (event) {
|
|
220
|
-
setInputValue(event.target.value);
|
|
221
|
-
setFilterOption('ALL');
|
|
222
|
-
}, []);
|
|
223
219
|
var topTags = useTopTags(sortedBonds);
|
|
224
220
|
var filterOptions = __spreadArray(__spreadArray(['ALL'], topTags, true), ['SOLD OUT'], false);
|
|
225
221
|
var _k = useState(filterOptions[0]), filterOption = _k[0], setFilterOption = _k[1];
|
|
@@ -250,6 +246,13 @@ var Bonds = function (_a) {
|
|
|
250
246
|
var handleChangeChainFilterOption = useCallback(function (newOptions) {
|
|
251
247
|
setChainFilterOption(newOptions);
|
|
252
248
|
}, [setChainFilterOption]);
|
|
249
|
+
var handleInputChange = function (event) {
|
|
250
|
+
setInputValue(event.target.value);
|
|
251
|
+
};
|
|
252
|
+
var handleChangeQuery = useCallback(function (event) {
|
|
253
|
+
setInputValue(event.target.value);
|
|
254
|
+
setFilterOption('ALL');
|
|
255
|
+
}, []);
|
|
253
256
|
// Page render logic
|
|
254
257
|
var _m = useState(false), bondsRendered = _m[0], setBondsRendered = _m[1];
|
|
255
258
|
useEffect(function () {
|
|
@@ -257,6 +260,6 @@ var Bonds = function (_a) {
|
|
|
257
260
|
setBondsRendered(true);
|
|
258
261
|
}
|
|
259
262
|
}, [billstoRender]);
|
|
260
|
-
return (_jsxs(ThemeUIProvider, { theme: defaultTheme, children: [isActive && account && _jsx("p", { children: account }), isActive && account && _jsx("button", { onClick: handleApprove, children: "Approve USDT" }), _jsxs(Flex, { className: "container table-container", children: [_jsx(BondRowHeader, { inputValue: inputValue, setChainFilterOption: handleChangeChainFilterOption, chainFilterOption: chainFilterOption !== null && chainFilterOption !== void 0 ? chainFilterOption : ['All Chains'], filterOptions: filterOptions, filterOption: filterOption, setFilterOption: handleChangeFilterOption, onHandleQueryChange: setInputValue, onSort: handleSort }), bondsRendered && (_jsx(BondRowsByChain, { bonds: billstoRender, hotBonds: hotBonds, hideTitles: inputValue !== '', rowClick: rowClick }))] })] }));
|
|
263
|
+
return (_jsxs(ThemeUIProvider, { theme: defaultTheme, children: [isActive && account && _jsx("p", { children: account }), isActive && account && _jsx("button", { onClick: handleApprove, children: "Approve USDT" }), _jsxs(Flex, { className: "container table-container", children: [_jsx(BondRowHeader, { inputValue: inputValue, setChainFilterOption: handleChangeChainFilterOption, chainFilterOption: chainFilterOption !== null && chainFilterOption !== void 0 ? chainFilterOption : ['All Chains'], filterOptions: filterOptions, filterOption: filterOption, setFilterOption: handleChangeFilterOption, onInputChange: handleInputChange, onHandleQueryChange: setInputValue, onSort: handleSort }), bondsRendered && (_jsx(BondRowsByChain, { bonds: billstoRender, hotBonds: hotBonds, hideTitles: inputValue !== '', rowClick: rowClick }))] })] }));
|
|
261
264
|
};
|
|
262
265
|
export default Bonds;
|