@ape.swap/bonds-sdk 1.0.540 → 1.0.542
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.
|
@@ -2,7 +2,6 @@ import { useQuery, useQueryClient } from '@tanstack/react-query';
|
|
|
2
2
|
import { QUERY_KEYS } from '../../config/constants/queryKeys';
|
|
3
3
|
import useCookie from '../../hooks/useCookie';
|
|
4
4
|
import { useCallback } from 'react';
|
|
5
|
-
// import { useRouter } from 'next/router'
|
|
6
5
|
export default function useChainFilterOption() {
|
|
7
6
|
var _a;
|
|
8
7
|
var _b = useCookie(QUERY_KEYS.CHAIN_FILTER_OPTION, ['All Chains']), cookie = _b.cookie, updateCookie = _b.updateCookie;
|
|
@@ -11,19 +10,17 @@ export default function useChainFilterOption() {
|
|
|
11
10
|
queryFn: function () { return cookie; },
|
|
12
11
|
initialData: cookie,
|
|
13
12
|
}).data;
|
|
14
|
-
var
|
|
15
|
-
var query = new URLSearchParams(window.location.search);
|
|
16
|
-
var pathname = window.location.pathname;
|
|
17
|
-
var urlParams = typeof window !== 'undefined' ? new URLSearchParams(new URL(asPath).search) : null;
|
|
13
|
+
var urlParams = typeof window !== 'undefined' ? new URLSearchParams(window.location.search) : null;
|
|
18
14
|
var urlChain = (_a = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('chain')) !== null && _a !== void 0 ? _a : '';
|
|
19
15
|
var queryClient = useQueryClient();
|
|
20
16
|
var removeURLChain = useCallback(function () {
|
|
21
|
-
if (urlChain) {
|
|
17
|
+
if (urlChain && urlParams) {
|
|
22
18
|
console.log('remove url');
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
urlParams.delete('chain');
|
|
20
|
+
var newUrl = "".concat(window.location.pathname, "?").concat(urlParams.toString());
|
|
21
|
+
window.history.replaceState({}, '', newUrl);
|
|
25
22
|
}
|
|
26
|
-
}, [urlChain,
|
|
23
|
+
}, [urlChain, urlParams]);
|
|
27
24
|
var setChainFilterOption = useCallback(function (newValue) {
|
|
28
25
|
updateCookie(newValue);
|
|
29
26
|
queryClient.setQueryData(["".concat(QUERY_KEYS.CHAIN_FILTER_OPTION)], newValue);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
declare const NetworkFilter: ({ chainFilterOption, setChainFilterOption, }: {
|
|
2
3
|
chainFilterOption: string[];
|
|
3
4
|
setChainFilterOption: (newValue: string[]) => void;
|
|
4
|
-
}) =>
|
|
5
|
+
}) => React.JSX.Element;
|
|
5
6
|
export default NetworkFilter;
|
|
@@ -9,9 +9,9 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
9
9
|
};
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "theme-ui/jsx-runtime";
|
|
11
11
|
import { useState } from 'react';
|
|
12
|
-
import { Flex, Svg, Text } from '
|
|
12
|
+
import { Flex, Svg, Text } from '../../components/uikit-sdk';
|
|
13
13
|
import { MAINNET_CHAINS, NETWORK_ICONS, NETWORK_LABEL } from '../../config/constants/chains';
|
|
14
|
-
import Checkbox from '
|
|
14
|
+
import Checkbox from '../../components/uikit-sdk/Checkbox';
|
|
15
15
|
var NetworkFilter = function (_a) {
|
|
16
16
|
var chainFilterOption = _a.chainFilterOption, setChainFilterOption = _a.setChainFilterOption;
|
|
17
17
|
var _b = useState(false), isOpen = _b[0], setIsOpen = _b[1];
|
|
@@ -5,6 +5,7 @@ export declare const QUERY_KEYS: {
|
|
|
5
5
|
LHD_PROFILE: string;
|
|
6
6
|
LHD_PASSWORD_VERIFIED: string;
|
|
7
7
|
HOMEPAGE_STATS: string;
|
|
8
|
+
BOND_PAGE_STATS: string;
|
|
8
9
|
LIVE_AND_UPCOMING: string;
|
|
9
10
|
TVL_STATS: string;
|
|
10
11
|
TOKEN_HISTORIC: string;
|
|
@@ -18,4 +19,6 @@ export declare const QUERY_KEYS: {
|
|
|
18
19
|
HOT_BONDS: string;
|
|
19
20
|
CHAIN_FILTER_OPTION: string;
|
|
20
21
|
AB_TEST_VALUE: string;
|
|
22
|
+
USE_CURRENCY_NEW: string;
|
|
23
|
+
CURRENCY_BALANCE: string;
|
|
21
24
|
};
|
|
@@ -5,6 +5,7 @@ export var QUERY_KEYS = {
|
|
|
5
5
|
LHD_PROFILE: 'lhdProfile',
|
|
6
6
|
LHD_PASSWORD_VERIFIED: 'lhdPasswordVerified',
|
|
7
7
|
HOMEPAGE_STATS: 'homepageStats',
|
|
8
|
+
BOND_PAGE_STATS: 'bondPageStats',
|
|
8
9
|
LIVE_AND_UPCOMING: 'liveAndUpcoming',
|
|
9
10
|
TVL_STATS: 'tvlStats',
|
|
10
11
|
TOKEN_HISTORIC: 'tokenHistoric',
|
|
@@ -18,4 +19,6 @@ export var QUERY_KEYS = {
|
|
|
18
19
|
HOT_BONDS: 'hotBonds',
|
|
19
20
|
CHAIN_FILTER_OPTION: 'chainFilterOption',
|
|
20
21
|
AB_TEST_VALUE: 'ABTestValue',
|
|
22
|
+
USE_CURRENCY_NEW: 'useCurrencyNew',
|
|
23
|
+
CURRENCY_BALANCE: 'currencyBalance',
|
|
21
24
|
};
|