@ape.swap/bonds-sdk 1.0.530 → 1.0.531

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.
@@ -5,23 +5,30 @@ import RecommendationSelector from '../MenuSelect/RecommendationSelector';
5
5
  import MenuSelect from '../MenuSelect/MenuSelect';
6
6
  import '../../scss/BondMenu.scss';
7
7
  import NetworkFilter from '../NetworkFilter';
8
- import { useRouter } from 'next/router';
9
8
  var BondMenu = function (_a) {
10
9
  var setChainFilterOption = _a.setChainFilterOption, chainFilterOption = _a.chainFilterOption, filterOptions = _a.filterOptions, filterOption = _a.filterOption, setFilterOption = _a.setFilterOption, onHandleQueryChange = _a.onHandleQueryChange;
11
- var _b = useRouter(), push = _b.push, replace = _b.replace, asPath = _b.asPath;
12
10
  var mappedFilters = filterOptions.map(function (filter) {
13
11
  return {
14
12
  label: filter.charAt(0).toUpperCase() + filter.slice(1).toLowerCase(),
15
13
  value: filter,
16
14
  };
17
15
  });
16
+ var push = function (url) {
17
+ window.location.assign(url);
18
+ };
19
+ var replace = function (url) {
20
+ window.location.replace(url);
21
+ };
22
+ var asPath = window.location.pathname + window.location.search;
18
23
  var handleFilterSelection = useCallback(function (newOption) {
19
24
  setChainFilterOption(['All Chains']);
20
25
  setFilterOption(newOption);
21
- }, [
22
- setChainFilterOption,
23
- setFilterOption
24
- ]);
26
+ // Update the URL without reloading the page
27
+ var urlParams = new URLSearchParams(window.location.search);
28
+ urlParams.set('filter', newOption);
29
+ var newUrl = "".concat(window.location.pathname, "?").concat(urlParams.toString());
30
+ window.history.replaceState(null, '', newUrl);
31
+ }, [setChainFilterOption, setFilterOption]);
25
32
  return (_jsxs(Flex, { className: "menu-container filters", children: [_jsx(Flex, { className: "filters desktop-rec", sx: { display: ['none', 'none', 'none', 'flex'], mr: '20px' }, children: _jsx(RecommendationSelector, { options: filterOptions, activeOption: filterOption, setActiveOption: handleFilterSelection }) }), _jsx(Flex, { className: "filtesr mobile-rec", sx: { display: ['flex', 'flex', 'flex', 'none'], width: '100%' }, children: _jsx(MenuSelect, { selectedOption: filterOption, setOption: setFilterOption, options: mappedFilters, sx: { background: 'white2' } }) }), _jsx(Flex, { className: "filters network", sx: { width: ['49%', '49%', '49%', 'unset'], minWidth: '120px' }, children: _jsx(NetworkFilter, { chainFilterOption: chainFilterOption, setChainFilterOption: setChainFilterOption }) }), _jsxs(Flex, { sx: {
26
33
  display: ['none', 'none', 'none', 'flex'],
27
34
  color: 'textDisabledButton',
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.530",
6
+ "version": "1.0.531",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",