@ape.swap/bonds-sdk 1.0.534 → 1.0.535
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.
|
@@ -6,19 +6,13 @@ import MenuSelect from '../MenuSelect/MenuSelect';
|
|
|
6
6
|
import '../../scss/BondMenu.scss';
|
|
7
7
|
import NetworkFilter from '../NetworkFilter';
|
|
8
8
|
var BondMenu = function (_a) {
|
|
9
|
-
var setChainFilterOption = _a.setChainFilterOption, chainFilterOption = _a.chainFilterOption, filterOptions = _a.filterOptions, filterOption = _a.filterOption, setFilterOption = _a.setFilterOption
|
|
9
|
+
var setChainFilterOption = _a.setChainFilterOption, chainFilterOption = _a.chainFilterOption, filterOptions = _a.filterOptions, filterOption = _a.filterOption, setFilterOption = _a.setFilterOption;
|
|
10
10
|
var mappedFilters = filterOptions.map(function (filter) {
|
|
11
11
|
return {
|
|
12
12
|
label: filter.charAt(0).toUpperCase() + filter.slice(1).toLowerCase(),
|
|
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']);
|
|
@@ -40,7 +34,6 @@ var BondMenu = function (_a) {
|
|
|
40
34
|
}, onClick: function () {
|
|
41
35
|
setChainFilterOption(['All Chains']);
|
|
42
36
|
setFilterOption(asPath.includes('yourBonds') ? 'CLAIMABLE' : 'ALL');
|
|
43
|
-
onHandleQueryChange('');
|
|
44
37
|
}, children: ["Clear All", _jsx(Flex, { sx: { ml: '7px' }, children: _jsx(IconButton, { icon: "close", color: "textDisabledButton", variant: "transparent" }) })] })] }));
|
|
45
38
|
};
|
|
46
39
|
export default BondMenu;
|
|
@@ -8,7 +8,7 @@ interface BondRowHeaderProps {
|
|
|
8
8
|
filterOptions: string[];
|
|
9
9
|
filterOption: string;
|
|
10
10
|
setFilterOption: (newOption: string) => void;
|
|
11
|
-
|
|
11
|
+
onInputChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
12
12
|
onSort: (key: 'discount' | 'arr' | 'terms' | 'tokensRemaining') => void;
|
|
13
13
|
}
|
|
14
14
|
declare const BondRowHeader: React.FC<BondRowHeaderProps>;
|
|
@@ -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,
|
|
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
|
|
9
|
+
var inputValue = _a.inputValue, setChainFilterOption = _a.setChainFilterOption, chainFilterOption = _a.chainFilterOption, filterOptions = _a.filterOptions, filterOption = _a.filterOption, setFilterOption = _a.setFilterOption, onInputChange = _a.onInputChange, 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 }) }), _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,9 @@ 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
|
+
};
|
|
253
252
|
// Page render logic
|
|
254
253
|
var _m = useState(false), bondsRendered = _m[0], setBondsRendered = _m[1];
|
|
255
254
|
useEffect(function () {
|
|
@@ -257,6 +256,6 @@ var Bonds = function (_a) {
|
|
|
257
256
|
setBondsRendered(true);
|
|
258
257
|
}
|
|
259
258
|
}, [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,
|
|
259
|
+
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, onSort: handleSort }), bondsRendered && (_jsx(BondRowsByChain, { bonds: billstoRender, hotBonds: hotBonds, hideTitles: inputValue !== '', rowClick: rowClick }))] })] }));
|
|
261
260
|
};
|
|
262
261
|
export default Bonds;
|