From 0ecfed7818cac40ffa1812add89657ffa5f56206 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 27 Oct 2023 23:10:21 +0900 Subject: [PATCH 1/6] Merge mainnet into develop (#1365) Co-authored-by: Chen Yu Co-authored-by: homura Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/constants/scripts.ts | 2 +- src/locales/en.json | 1 + src/locales/zh.json | 1 + src/pages/ScriptList/index.tsx | 4 ++-- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/constants/scripts.ts b/src/constants/scripts.ts index 8cae750e7..b717f7268 100644 --- a/src/constants/scripts.ts +++ b/src/constants/scripts.ts @@ -243,7 +243,7 @@ export const MainnetContractHashTags: ContractHashTag[] = [ txHashes: ['0xf05188e5f3a6767fc4687faf45ba5f1a6e25d3ada6129dae8722cb282f262493-0'], depType: 'dep_group', hashType: 'type', - tag: 'joy_id', + tag: 'JoyID', category: 'lock', }, ] diff --git a/src/locales/en.json b/src/locales/en.json index 0577fe013..6a0e4f541 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -422,6 +422,7 @@ "cota": "CoTA", "spore_cluster": "Spore Cluster", "spore": "Spore", + "joy_id": "JoyID", "unknown_nft": "anonymous", "nft_limited": "Limited", "nft_unlimited": "Unlimited", diff --git a/src/locales/zh.json b/src/locales/zh.json index e46c96669..6eaf3be74 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -420,6 +420,7 @@ "cota": "CoTA", "spore_cluster": "Spore Cluster", "spore": "Spore", + "joy_id": "Joy ID", "unknown_nft": "匿名", "nft_limited": "限量", "nft_unlimited": "不限量", diff --git a/src/pages/ScriptList/index.tsx b/src/pages/ScriptList/index.tsx index f3d98e0aa..6e06be2b8 100644 --- a/src/pages/ScriptList/index.tsx +++ b/src/pages/ScriptList/index.tsx @@ -187,9 +187,9 @@ export const scripts = new Map([ }, ], [ - 'joy_id', + 'JoyID', { - name: 'joy_id', + name: 'JoyID', description: 'An universal Account Protocol for Web3 Mass-adoption.', doc: 'https://docs.joy.id/', website: ' https://joy.id/', From 157ec8e17837b367d33a0e49157a33fd4d7a7d66 Mon Sep 17 00:00:00 2001 From: Shinya Date: Mon, 30 Oct 2023 17:14:55 +0800 Subject: [PATCH 2/6] fix: transfer udt amount decimals (#129) * fix: show transfer udt amount * fix: unknown amount * chore: rename useGetTransferItemTag hook --- src/locales/en.json | 1 + src/locales/zh.json | 1 + .../TransactionLite/TransactionLite.tsx | 60 ++++++++++++------- 3 files changed, 40 insertions(+), 22 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 6a0e4f541..57c280b51 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -560,6 +560,7 @@ "decimal": "Decimal", "search_placeholder": "Transaction / Address", "unknown_token": "Unknown Token", + "unknown_amount": "Unknown Amount", "submit_token_info": "Submit Token Info", "unknown_token_description": "The token’s information is incomplete. If you are the owner of this token, please submit token info.", "tokens": "Tokens", diff --git a/src/locales/zh.json b/src/locales/zh.json index 6eaf3be74..752b7630c 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -560,6 +560,7 @@ "decimal": "小数位", "search_placeholder": "交易/地址", "unknown_token": "未知资产", + "unknown_amount": "未知数量", "submit_token_info": "提交代币信息", "unknown_token_description": "此代币信息暂时不完整,如果你是此代币的拥有者,请提交代币信息", "tokens": "代币", diff --git a/src/pages/Transaction/TransactionComp/TransactionLite/TransactionLite.tsx b/src/pages/Transaction/TransactionComp/TransactionLite/TransactionLite.tsx index 0a437f7d8..c070856c1 100644 --- a/src/pages/Transaction/TransactionComp/TransactionLite/TransactionLite.tsx +++ b/src/pages/Transaction/TransactionComp/TransactionLite/TransactionLite.tsx @@ -3,9 +3,10 @@ import { FC } from 'react' import { useQuery } from 'react-query' import { useParams } from 'react-router-dom' import BigNumber from 'bignumber.js' +import { useTranslation } from 'react-i18next' import styles from './TransactionLite.module.scss' import DecimalCapacity from '../../../../components/DecimalCapacity' -import { parseCKBAmount, localeNumberString } from '../../../../utils/number' +import { parseCKBAmount, localeNumberString, parseUDTAmount } from '../../../../utils/number' import { shannonToCkb } from '../../../../utils/util' import { Addr } from '../../TransactionCell' import { defaultTransactionLiteDetails } from '../../state' @@ -13,27 +14,30 @@ import { TransactionBadge } from './TransactionBadge' import { TransactionRecord, TransactionRecordTransfer, explorerService } from '../../../../services/ExplorerService' import { useIsMobile } from '../../../../utils/hook' -const getTransferItemTag = (transfer: TransactionRecordTransfer) => { - const { cellType, udtInfo, mNftInfo } = transfer - if (cellType === 'm_nft_token' || cellType === 'm_nft_class' || cellType === 'm_nft_issuer') { - return `NFT-${mNftInfo?.className ?? 'Unknown'}` - } - if (cellType === 'udt') { - return udtInfo?.symbol || `Uknown Asset #${udtInfo?.typeHash.substring(udtInfo.typeHash.length - 4)}` - } - if (cellType === 'spore_cell' || cellType === 'spore_cluster') { - return 'Spore' - } - if (cellType === 'cota_regular' || cellType === 'cota_registry') { - return 'Cota' - } - if (cellType === 'nervos_dao_deposit' || cellType === 'nervos_dao_withdrawing') { - return 'Nervos DAO' - } - if (cellType === 'nrc_721_token' || cellType === 'nrc_721_factory') { - return 'NRC-721' +const useGetTransferItemTag = () => { + const { t } = useTranslation() + return (transfer: TransactionRecordTransfer) => { + const { cellType, udtInfo, mNftInfo } = transfer + if (cellType === 'm_nft_token' || cellType === 'm_nft_class' || cellType === 'm_nft_issuer') { + return `NFT-${mNftInfo?.className ?? 'Unknown'}` + } + if (cellType === 'udt') { + return udtInfo?.symbol || `${t('udt.unknown_token')} #${udtInfo?.typeHash.substring(udtInfo.typeHash.length - 4)}` + } + if (cellType === 'spore_cell' || cellType === 'spore_cluster') { + return 'Spore' + } + if (cellType === 'cota_regular' || cellType === 'cota_registry') { + return 'Cota' + } + if (cellType === 'nervos_dao_deposit' || cellType === 'nervos_dao_withdrawing') { + return 'Nervos DAO' + } + if (cellType === 'nrc_721_token' || cellType === 'nrc_721_factory') { + return 'NRC-721' + } + return 'CKB' } - return 'CKB' } export const TransactionCompLite: FC<{ isCellbase: boolean }> = ({ isCellbase }) => { @@ -67,6 +71,7 @@ export const TransactionCompLite: FC<{ isCellbase: boolean }> = ({ isCellbase }) export const DesktopTransferItems = (props: { details: TransactionRecord }) => { const { details } = props const { transfers } = details + const getTransferItemTag = useGetTransferItemTag() return (
{transfers.map((transfer, index) => { @@ -87,6 +92,7 @@ export const DesktopTransferItems = (props: { details: TransactionRecord }) => { export const MobileTransferItems = (props: { details: TransactionRecord }) => { const { details } = props const { transfers } = details + const getTransferItemTag = useGetTransferItemTag() return (
{transfers.map((transfer, index) => { @@ -111,6 +117,7 @@ export const MobileTransferItems = (props: { details: TransactionRecord }) => { } const TransferAmount: FC<{ transfer: TransactionRecordTransfer }> = ({ transfer }) => { + const { t } = useTranslation() const isUdt = transfer.cellType === 'udt' const isNft = transfer.cellType === 'm_nft_token' @@ -119,7 +126,16 @@ const TransferAmount: FC<{ transfer: TransactionRecordTransfer }> = ({ transfer const isIncome = isUdt ? transferAmount.isPositive() : transferCapacity.isPositive() const decimalPanelType = isIncome ? 'income' : 'payment' - const amountChange = localeNumberString(shannonToCkb(transferAmount)) + const udtDecimals = transfer.udtInfo?.decimal + let amountChange: string + if (udtDecimals) { + amountChange = parseUDTAmount(transferAmount.toString(), udtDecimals) + } else if (isIncome) { + amountChange = t('udt.unknown_amount') + } else { + amountChange = `-${t('udt.unknown_amount')}` + } + const capacityChange = localeNumberString(shannonToCkb(transferCapacity)) const isIncomeColor = isIncome ? styles.add : styles.subtraction From b3586b67a19936cdae1854fd8388c0bc780a5642 Mon Sep 17 00:00:00 2001 From: WhiteMind Date: Wed, 1 Nov 2023 13:51:04 +0800 Subject: [PATCH 3/6] Adapting the NftCollections page to the new design draft (#126) * refactor: implementation of the gap in the NFT table * feat: adapting the NFTCollections page to the latest design draft * feat: more reasonable interaction logic * feat: modify the filter icon and sort icon --- src/assets/filter_icon.svg | 6 +- src/assets/sort_icon.svg | 4 +- src/components/SortButton/index.tsx | 38 +++---- src/components/SortButton/styles.module.scss | 4 +- .../NftCollectionInfo/styles.module.scss | 7 +- src/pages/NftCollections/List.tsx | 41 +++++-- src/pages/NftCollections/filter.svg | 3 + src/pages/NftCollections/index.tsx | 8 +- src/pages/NftCollections/styles.module.scss | 103 ++++++++---------- src/pages/NftCollections/util.ts | 8 ++ src/pages/SimpleUDT/styles.module.scss | 8 +- src/services/ExplorerService/fetcher.ts | 2 +- src/utils/array.ts | 5 + src/utils/hook.ts | 6 +- 14 files changed, 127 insertions(+), 116 deletions(-) create mode 100644 src/pages/NftCollections/filter.svg create mode 100644 src/pages/NftCollections/util.ts diff --git a/src/assets/filter_icon.svg b/src/assets/filter_icon.svg index 602921bd9..0da889d49 100644 --- a/src/assets/filter_icon.svg +++ b/src/assets/filter_icon.svg @@ -1,3 +1,3 @@ - - - \ No newline at end of file + + + diff --git a/src/assets/sort_icon.svg b/src/assets/sort_icon.svg index a83d5ba7c..161fc0df9 100644 --- a/src/assets/sort_icon.svg +++ b/src/assets/sort_icon.svg @@ -1,4 +1,4 @@ - - + + diff --git a/src/components/SortButton/index.tsx b/src/components/SortButton/index.tsx index 74a05130f..fde14a6f6 100644 --- a/src/components/SortButton/index.tsx +++ b/src/components/SortButton/index.tsx @@ -1,39 +1,27 @@ -import { useHistory, useLocation } from 'react-router-dom' import { ReactComponent as SortIcon } from '../../assets/sort_icon.svg' import styles from './styles.module.scss' - -enum SortOrder { - Asc = 'asc', - Desc = 'desc', -} +import { useSortParam } from '../../utils/hook' /* * REFACTOR: could be refactored for https://github.com/Magickbase/ckb-explorer-frontend/pull/8#discussion_r1267484265 */ -const SortButton: React.FC<{ - field: string -}> = ({ field }) => { - const { push } = useHistory() - const { search, pathname } = useLocation() - - const query = new URLSearchParams(search) - - const [sortKey, sortOrder] = query.get('sort')?.split('.') ?? [] - - const isActive = sortKey === field +export function SortButton({ + field, + sortParam, +}: { + field: T + sortParam?: ReturnType> +}) { + const sortParamByQuery = useSortParam() + const { sortBy, orderBy, handleSortClick } = sortParam ?? sortParamByQuery + const isActive = sortBy === field const handleClick = () => { - const shouldAsc = isActive && sortOrder === SortOrder.Desc - push( - `${pathname}?${new URLSearchParams({ - ...Object.fromEntries(query), - sort: shouldAsc ? `${field}.${SortOrder.Asc}` : `${field}.${SortOrder.Desc}`, - })}`, - ) + handleSortClick(field) } return ( - ) diff --git a/src/components/SortButton/styles.module.scss b/src/components/SortButton/styles.module.scss index ee10ee868..9c9a82091 100644 --- a/src/components/SortButton/styles.module.scss +++ b/src/components/SortButton/styles.module.scss @@ -3,9 +3,9 @@ border: none; outline: none; background: none; - display: inline-block; + display: inline-flex; vertical-align: text-top; - margin: 0 8px; + margin-left: 8px; cursor: pointer; &[data-order='desc'] { diff --git a/src/pages/NftCollectionInfo/styles.module.scss b/src/pages/NftCollectionInfo/styles.module.scss index 12daf13bf..7f8a999ff 100644 --- a/src/pages/NftCollectionInfo/styles.module.scss +++ b/src/pages/NftCollectionInfo/styles.module.scss @@ -244,13 +244,12 @@ padding-left: 0.8rem; svg { - height: 1rem; - width: 1rem; + color: #999; } &[data-is-active='true'] { - svg path { - fill: var(--primary-color); + svg { + color: var(--primary-color); } } } diff --git a/src/pages/NftCollections/List.tsx b/src/pages/NftCollections/List.tsx index 1e60c7a85..f9dc5a046 100644 --- a/src/pages/NftCollections/List.tsx +++ b/src/pages/NftCollections/List.tsx @@ -6,13 +6,13 @@ import { Trans, useTranslation } from 'react-i18next' import SortButton from '../../components/SortButton' import { handleNftImgError, patchMibaoImg } from '../../utils/util' import { ReactComponent as SelectedCheckIcon } from '../../assets/selected_check_icon.svg' -import { ReactComponent as FilterIcon } from '../../assets/filter_icon.svg' +import { ReactComponent as FilterIcon } from './filter.svg' import { getPrimaryColor } from '../../constants/common' -import { useIsMobile, useSearchParams, useSortParam } from '../../utils/hook' +import { useIsMobile, useSearchParams } from '../../utils/hook' import styles from './styles.module.scss' import type { NFTCollection } from '../../services/ExplorerService/fetcher' +import { useNFTCollectionsSortParam } from './util' -type NftSortField = 'transactions' | 'holder' | 'minted' const primaryColor = getPrimaryColor() function useFilterList(): Record<'title' | 'value', string>[] { const { t } = useTranslation() @@ -80,30 +80,35 @@ const TypeFilter = () => { const HolderMinterSort = () => { const { t } = useTranslation() - const { sortBy, handleSortClick } = useSortParam( - s => s === 'transactions' || s === 'holder' || s === 'minted', - ) + const sortParam = useNFTCollectionsSortParam() + const { sortBy, handleSortClick } = sortParam return (
+ {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}
handleSortClick('holder')} - aria-hidden + role="button" + tabIndex={0} > {t('nft.holder')} + {sortBy === 'holder' && }
-  /  + / + {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}
handleSortClick('minted')} - aria-hidden + role="button" + tabIndex={0} > {t('nft.minted')} + {sortBy !== 'holder' && }
) @@ -144,6 +149,8 @@ const TypeInfo: React.FC<{ nft: NFTCollection }> = ({ nft: item }) => { export const ListOnDesktop: React.FC<{ isLoading: boolean; list: NFTCollection[] }> = ({ list, isLoading }) => { const { t } = useTranslation() + const sortParam = useNFTCollectionsSortParam() + return ( @@ -154,8 +161,11 @@ export const ListOnDesktop: React.FC<{ isLoading: boolean; list: NFTCollection[] - {data.cells.map(record => { + {data?.cells.map(record => { return (
- {t('nft.transactions')} - + {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */} + sortParam.handleSortClick('transactions')} role="button" tabIndex={0}> + {t('nft.transactions')} + + @@ -247,10 +257,19 @@ export const ListOnDesktop: React.FC<{ isLoading: boolean; list: NFTCollection[] export const ListOnMobile: React.FC<{ isLoading: boolean; list: NFTCollection[] }> = ({ list, isLoading }) => { const { t } = useTranslation() + const sortParam = useNFTCollectionsSortParam() + return (
+ + {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */} + sortParam.handleSortClick('transactions')} role="button" tabIndex={0}> + {t('nft.transactions')} + + +
diff --git a/src/pages/NftCollections/filter.svg b/src/pages/NftCollections/filter.svg new file mode 100644 index 000000000..0da889d49 --- /dev/null +++ b/src/pages/NftCollections/filter.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/pages/NftCollections/index.tsx b/src/pages/NftCollections/index.tsx index 74b4d84b8..46c1beaf1 100644 --- a/src/pages/NftCollections/index.tsx +++ b/src/pages/NftCollections/index.tsx @@ -7,13 +7,12 @@ import Pagination from '../../components/Pagination' import { getPrimaryColor } from '../../constants/common' import { explorerService } from '../../services/ExplorerService' import { udtSubmitEmail } from '../../utils/util' -import { useSearchParams, useSortParam } from '../../utils/hook' +import { useSearchParams } from '../../utils/hook' import styles from './styles.module.scss' +import { useNFTCollectionsSortParam } from './util' const primaryColor = getPrimaryColor() -type NftSortByType = 'transactions' | 'holder' | 'minted' - const submitTokenInfoUrl = udtSubmitEmail() const NftCollections = () => { @@ -21,8 +20,7 @@ const NftCollections = () => { const { t } = useTranslation() const { search } = useLocation() const { page = '1', type } = useSearchParams('page', 'type') - - const { sort = 'holder' } = useSortParam(s => s === 'transactions' || s === 'holder' || s === 'minted') + const { sort } = useNFTCollectionsSortParam() const isValidFilter = isTxFilterType(type) && type !== 'all' diff --git a/src/pages/NftCollections/styles.module.scss b/src/pages/NftCollections/styles.module.scss index 8bf5e3e82..ec7dc5642 100644 --- a/src/pages/NftCollections/styles.module.scss +++ b/src/pages/NftCollections/styles.module.scss @@ -22,70 +22,47 @@ overflow: hidden; table { - background: #fff; position: relative; width: 100%; margin-bottom: 4px; - - .typeFilter, - .holderMinted { - justify-content: end; - } + color: #333; } thead { - position: relative; - font-size: 14px; - font-weight: 700; + tr { + background: #fff; + border-bottom: 4px solid var(--table-separator-color); + } th { - vertical-align: middle; - padding-top: 12px; - padding-bottom: 12px; + line-height: 56px; + font-size: 16px; + font-weight: 400; text-transform: capitalize; white-space: nowrap; } - - &::after { - position: absolute; - left: -15px; - top: 44px; - width: calc(100% + 30px); - height: 4px; - content: ''; - display: block; - background-color: #ededed; - } } tbody { - td { - padding-top: 15px; - padding-bottom: 15px; - font-size: 14px; + tr { + background: #fff; + + &:not(:last-child) { + border-bottom: 1px solid var(--table-separator-color); + } } - tr:not(:last-child) { - border-bottom: 1px solid var(--table-separator-color); + td { + line-height: 64px; + font-size: 14px; } } th, td { text-align: left; - padding-left: 25px; - padding-right: 25px; + padding: 0 24px; max-width: 0.25vw; - - &:not(:first-of-type) { - text-align: right; - } - - &:first-child, - &:last-child { - padding-left: 25px; - padding-right: 25px; - } } .name { @@ -126,8 +103,8 @@ } &[data-is-active='true'] { - svg path { - fill: var(--primary-color); + .filter { + color: var(--primary-color); } } } @@ -143,7 +120,8 @@ } .filter { - height: 1rem; + margin-left: 8px; + color: #999; } } @@ -201,6 +179,10 @@ .transactionsHeader { > span { + display: flex; + align-items: center; + cursor: pointer; + &.sortActive { color: var(--primary-color); } @@ -214,11 +196,20 @@ .holderMinted { display: flex; align-items: center; - cursor: pointer; .sortActive { color: var(--primary-color); } + + .divider { + margin: 0 4px; + } + + & > div { + display: flex; + align-items: center; + cursor: pointer; + } } div[data-role='mobile-list'] { @@ -227,18 +218,20 @@ div[data-role='mobile-list'] { .listHeader { display: flex; - height: 3rem; + flex-wrap: wrap; + row-gap: 20px; + padding: 16px; + margin-bottom: 10px; + font-size: 16px; + color: #333; background: #fff; + border-radius: 8px; + overflow: hidden; & > div { white-space: nowrap; - flex: 1; + flex: 1 50%; } - - padding: 0 1rem; - border-radius: 8px; - overflow: hidden; - margin-bottom: 10px; } dl { @@ -282,10 +275,6 @@ div[data-role='mobile-list'] { } } - .holderMinted { - padding-left: 36px; - } - .loading { text-align: center; } @@ -305,7 +294,7 @@ div[data-role='mobile-list'] { @media screen and (width <= 1000px) { .container { - margin: 40px 8px 60px; + margin: 20px 16px 60px; table[data-role='desktop-list'] { display: none; diff --git a/src/pages/NftCollections/util.ts b/src/pages/NftCollections/util.ts new file mode 100644 index 000000000..0a647948b --- /dev/null +++ b/src/pages/NftCollections/util.ts @@ -0,0 +1,8 @@ +import { includes } from '../../utils/array' +import { useSortParam } from '../../utils/hook' + +const NFTSortByTypes = ['transactions', 'holder', 'minted'] as const +type NFTSortByType = (typeof NFTSortByTypes)[number] + +export const useNFTCollectionsSortParam = () => + useSortParam(s => includes(NFTSortByTypes, s), 'holder.asc') diff --git a/src/pages/SimpleUDT/styles.module.scss b/src/pages/SimpleUDT/styles.module.scss index e9d2e39b2..ab52aebc3 100644 --- a/src/pages/SimpleUDT/styles.module.scss +++ b/src/pages/SimpleUDT/styles.module.scss @@ -28,6 +28,7 @@ } .searchAndfilter { + display: flex; align-items: center; > div:last-child { @@ -46,13 +47,12 @@ padding-left: 0.8rem; svg { - height: 1rem; - width: 1rem; + color: #999; } &[data-is-active='true'] { - svg path { - fill: var(--primary-color); + svg { + color: var(--primary-color); } } } diff --git a/src/services/ExplorerService/fetcher.ts b/src/services/ExplorerService/fetcher.ts index 2a278e843..58c80f425 100644 --- a/src/services/ExplorerService/fetcher.ts +++ b/src/services/ExplorerService/fetcher.ts @@ -579,7 +579,7 @@ export const apiFetcher = { .then(res => toCamelcase(res.data)) }, - fetchNFTCollections: (page: string, sort: string, type?: string) => + fetchNFTCollections: (page: string, sort?: string, type?: string) => requesterV2 .get<{ data: NFTCollection[] diff --git a/src/utils/array.ts b/src/utils/array.ts index 792e77301..c82324c96 100644 --- a/src/utils/array.ts +++ b/src/utils/array.ts @@ -2,6 +2,11 @@ export function unique(arr: T[]): T[] { return Array.from(new Set(arr)) } +// https://fettblog.eu/typescript-array-includes/ +export function includes(coll: readonly T[], el: U): el is T { + return coll.includes(el as T) +} + export const BooleanT = () => (a: T | '' | 0 | 0n | false | null | undefined | void): a is T => { diff --git a/src/utils/hook.ts b/src/utils/hook.ts index 3cfc81778..c0a970fa4 100644 --- a/src/utils/hook.ts +++ b/src/utils/hook.ts @@ -186,7 +186,8 @@ export type OrderByType = 'asc' | 'desc' // REFACTOR: remove useSearchParams export function useSortParam( - isSortBy: (s?: string) => boolean, + isSortBy?: (s?: string) => boolean, + defaultValue?: string, ): { sortBy: T | undefined orderBy: OrderByType @@ -195,12 +196,13 @@ export function useSortParam( } { type SortType = T | undefined function isSortByType(s?: string): s is SortType { + if (!isSortBy) return true return isSortBy(s) || s === undefined } function isOrderByType(s?: string): s is OrderByType { return s === 'asc' || s === 'desc' } - const { sort: sortParam } = useSearchParams('sort') + const { sort: sortParam = defaultValue } = useSearchParams('sort') const updateSearchParams = useUpdateSearchParams<'sort' | 'page'>() let sortBy: SortType let orderBy: OrderByType = 'asc' From 808f4925be7e3ef662ed532f19899f8eb997831a Mon Sep 17 00:00:00 2001 From: WhiteMind Date: Wed, 1 Nov 2023 14:21:19 +0800 Subject: [PATCH 4/6] Modify the default sorting of the tokens page (#128) feat: modify the default sorting of the tokens page --- src/pages/Tokens/index.tsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/pages/Tokens/index.tsx b/src/pages/Tokens/index.tsx index e40ed673d..989b1303e 100644 --- a/src/pages/Tokens/index.tsx +++ b/src/pages/Tokens/index.tsx @@ -1,5 +1,5 @@ import { Tooltip } from 'antd' -import { Link, useHistory } from 'react-router-dom' +import { Link } from 'react-router-dom' import { useQuery } from 'react-query' import { useTranslation } from 'react-i18next' import Content from '../../components/Content' @@ -23,7 +23,7 @@ import Loading from '../../components/Loading' import { udtSubmitEmail } from '../../utils/util' import SmallLoading from '../../components/Loading/SmallLoading' import styles from './styles.module.scss' -import { useIsMobile, usePaginationParamsInPage } from '../../utils/hook' +import { useIsMobile, usePaginationParamsInPage, useSortParam } from '../../utils/hook' import { explorerService } from '../../services/ExplorerService' import { QueryResult } from '../../components/QueryResult' import { UDT } from '../../models/UDT' @@ -98,9 +98,8 @@ export default () => { const isMobile = useIsMobile() const { t } = useTranslation() const { currentPage, pageSize: _pageSize, setPage } = usePaginationParamsInPage() - - const { location } = useHistory() - const sort = new URLSearchParams(location.search).get('sort') + const sortParam = useSortParam(undefined, 'transactions.desc') + const { sort } = sortParam const query = useQuery(['tokens', currentPage, _pageSize, sort], async () => { const { @@ -134,15 +133,15 @@ export default () => { {!isMobile && {t('udt.uan_name')}} {t('udt.transactions')} - + {t('udt.address_count')} - + {t('udt.created_time')} - + From 5113993cc936a9b70207d4f8cbe87f8d95be4085 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 18:46:12 +0900 Subject: [PATCH 5/6] chore(deps): update dependency eslint to v8 (#90) * chore(deps): update dependency eslint to v8 * chore: update @typescript-eslint/* --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Keith --- package.json | 8 +- yarn.lock | 444 +++++++++++++++++++++++++++------------------------ 2 files changed, 239 insertions(+), 213 deletions(-) diff --git a/package.json b/package.json index b892a8aec..0cf24d042 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@sentry/webpack-plugin": "2.7.1", "@testing-library/react": "12.1.5", "@types/echarts": "4.9.19", - "@types/eslint": "7.29.0", + "@types/eslint": "8.44.6", "@types/jest": "26.0.24", "@types/node": "16.18.58", "@types/react": "17.0.65", @@ -49,11 +49,11 @@ "@types/react-router-dom": "5.3.3", "@types/react-test-renderer": "^18.0.0", "@types/styled-components": "5.1.28", - "@typescript-eslint/eslint-plugin": "^4.29.0", - "@typescript-eslint/parser": "5.62.0", + "@typescript-eslint/eslint-plugin": "^6.9.1", + "@typescript-eslint/parser": "6.9.1", "antd-dayjs-webpack-plugin": "^1.0.6", "create-react-app": "^5.0.0", - "eslint": "7.32.0", + "eslint": "8.52.0", "eslint-config-airbnb": "18.2.1", "eslint-config-prettier": "9.0.0", "eslint-plugin-import": "^2.28.1", diff --git a/yarn.lock b/yarn.lock index 858227f04..06a6d220d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@aashutoshrathi/word-wrap@^1.2.3": + version "1.2.6" + resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" + integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== + "@adobe/css-tools@^4.0.1": version "4.3.1" resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.3.1.tgz#abfccb8ca78075a2b6187345c26243c1a0842f28" @@ -75,13 +80,6 @@ jsonpointer "^5.0.0" leven "^3.1.0" -"@babel/code-frame@7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" - integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== - dependencies: - "@babel/highlight" "^7.10.4" - "@babel/code-frame@^7.0.0": version "7.22.10" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.10.tgz#1c20e612b768fefa75f6e90d6ecb86329247f0a3" @@ -1755,20 +1753,22 @@ resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.7.5.tgz#77211291c1900a700b8a78cfafda3160d76949ed" integrity sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg== -"@eslint/eslintrc@^0.4.3": - version "0.4.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" - integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== +"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" + integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== dependencies: - ajv "^6.12.4" - debug "^4.1.1" - espree "^7.3.0" - globals "^13.9.0" - ignore "^4.0.6" - import-fresh "^3.2.1" - js-yaml "^3.13.1" - minimatch "^3.0.4" - strip-json-comments "^3.1.1" + eslint-visitor-keys "^3.3.0" + +"@eslint-community/regexpp@^4.5.1": + version "4.10.0" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63" + integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== + +"@eslint-community/regexpp@^4.6.1": + version "4.9.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.9.1.tgz#449dfa81a57a1d755b09aa58d826c1262e4283b4" + integrity sha512-Y27x+MBLjXa+0JWDhykM3+JE+il3kHKAEqabfEWq3SDhZjLYb6/BHL/JKFnH3fe207JaXkyDo685Oc2Glt6ifA== "@eslint/eslintrc@^1.4.0": version "1.4.0" @@ -1785,6 +1785,35 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" +"@eslint/eslintrc@^2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.2.tgz#c6936b4b328c64496692f76944e755738be62396" + integrity sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g== + dependencies: + ajv "^6.12.4" + debug "^4.3.2" + espree "^9.6.0" + globals "^13.19.0" + ignore "^5.2.0" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.1.2" + strip-json-comments "^3.1.1" + +"@eslint/js@8.52.0": + version "8.52.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.52.0.tgz#78fe5f117840f69dc4a353adf9b9cd926353378c" + integrity sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA== + +"@humanwhocodes/config-array@^0.11.13": + version "0.11.13" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.13.tgz#075dc9684f40a531d9b26b0822153c1e832ee297" + integrity sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ== + dependencies: + "@humanwhocodes/object-schema" "^2.0.1" + debug "^4.1.1" + minimatch "^3.0.5" + "@humanwhocodes/config-array@^0.11.8": version "0.11.8" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz#03595ac2075a4dc0f191cc2131de14fbd7d410b9" @@ -1794,30 +1823,21 @@ debug "^4.1.1" minimatch "^3.0.5" -"@humanwhocodes/config-array@^0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" - integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== - dependencies: - "@humanwhocodes/object-schema" "^1.2.0" - debug "^4.1.1" - minimatch "^3.0.4" - "@humanwhocodes/module-importer@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== -"@humanwhocodes/object-schema@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf" - integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w== - "@humanwhocodes/object-schema@^1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== +"@humanwhocodes/object-schema@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz#e5211452df060fa8522b55c7b3c0c4d1981cb044" + integrity sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw== + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -2652,10 +2672,10 @@ "@types/estree" "*" "@types/json-schema" "*" -"@types/eslint@7.29.0": - version "7.29.0" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.29.0.tgz#e56ddc8e542815272720bb0b4ccc2aff9c3e1c78" - integrity sha512-VNcvioYDH8/FxaeTKkM4/TiTwt6pBV9E3OfGmvaw8tPl0rrHCJ4Ll15HRT+pMiFAf/MLQvAzC+6RzUMEL9Ceng== +"@types/eslint@8.44.6": + version "8.44.6" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.44.6.tgz#60e564551966dd255f4c01c459f0b4fb87068603" + integrity sha512-P6bY56TVmX8y9J87jHNgQh43h6VVU+6H7oN7hgvivV81K2XY8qJZ5vqPy/HdUoVIelii2kChYVzQanlswPWVFw== dependencies: "@types/estree" "*" "@types/json-schema" "*" @@ -2768,16 +2788,16 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339" integrity sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA== +"@types/json-schema@^7.0.12": + version "7.0.14" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.14.tgz#74a97a5573980802f32c8e47b663530ab3b6b7d1" + integrity sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw== + "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.11" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== -"@types/json-schema@^7.0.7": - version "7.0.12" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.12.tgz#d70faba7039d5fca54c83c7dbab41051d2b6f6cb" - integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== - "@types/json5@^0.0.29": version "0.0.29" resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" @@ -2948,6 +2968,11 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw== +"@types/semver@^7.5.0": + version "7.5.4" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.4.tgz#0a41252ad431c473158b22f9bfb9a63df7541cff" + integrity sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ== + "@types/serve-index@^1.9.1": version "1.9.1" resolved "https://registry.yarnpkg.com/@types/serve-index/-/serve-index-1.9.1.tgz#1b5e85370a192c01ec6cec4735cf2917337a6278" @@ -3027,20 +3052,6 @@ resolved "https://registry.yarnpkg.com/@types/zrender/-/zrender-4.0.0.tgz#a6806f12ec4eccaaebd9b0d816f049aca6188fbd" integrity sha512-s89GOIeKFiod2KSqHkfd2rzx+T2DVu7ihZCBEBnhFrzvQPUmzvDSBot9Fi1DfMQm9Odg+rTqoMGC38RvrwJK2w== -"@typescript-eslint/eslint-plugin@^4.29.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz#c24dc7c8069c7706bc40d99f6fa87edcb2005276" - integrity sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg== - dependencies: - "@typescript-eslint/experimental-utils" "4.33.0" - "@typescript-eslint/scope-manager" "4.33.0" - debug "^4.3.1" - functional-red-black-tree "^1.0.1" - ignore "^5.1.8" - regexpp "^3.1.0" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/eslint-plugin@^5.5.0": version "5.47.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.47.0.tgz#dadb79df3b0499699b155839fd6792f16897d910" @@ -3056,17 +3067,22 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz#6f2a786a4209fa2222989e9380b5331b2810f7fd" - integrity sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q== +"@typescript-eslint/eslint-plugin@^6.9.1": + version "6.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.9.1.tgz#d8ce497dc0ed42066e195c8ecc40d45c7b1254f4" + integrity sha512-w0tiiRc9I4S5XSXXrMHOWgHgxbrBn1Ro+PmiYhSg2ZVdxrAJtQgzU5o2m1BfP6UOn7Vxcc6152vFjQfmZR4xEg== dependencies: - "@types/json-schema" "^7.0.7" - "@typescript-eslint/scope-manager" "4.33.0" - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/typescript-estree" "4.33.0" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" + "@eslint-community/regexpp" "^4.5.1" + "@typescript-eslint/scope-manager" "6.9.1" + "@typescript-eslint/type-utils" "6.9.1" + "@typescript-eslint/utils" "6.9.1" + "@typescript-eslint/visitor-keys" "6.9.1" + debug "^4.3.4" + graphemer "^1.4.0" + ignore "^5.2.4" + natural-compare "^1.4.0" + semver "^7.5.4" + ts-api-utils "^1.0.1" "@typescript-eslint/experimental-utils@^5.0.0": version "5.47.0" @@ -3075,14 +3091,15 @@ dependencies: "@typescript-eslint/utils" "5.47.0" -"@typescript-eslint/parser@5.62.0": - version "5.62.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.62.0.tgz#1b63d082d849a2fcae8a569248fbe2ee1b8a56c7" - integrity sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA== +"@typescript-eslint/parser@6.9.1": + version "6.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.9.1.tgz#4f685f672f8b9580beb38d5fb99d52fc3e34f7a3" + integrity sha512-C7AK2wn43GSaCUZ9do6Ksgi2g3mwFkMO3Cis96kzmgudoVaKyt62yNzJOktP0HDLb/iO2O0n2lBOzJgr6Q/cyg== dependencies: - "@typescript-eslint/scope-manager" "5.62.0" - "@typescript-eslint/types" "5.62.0" - "@typescript-eslint/typescript-estree" "5.62.0" + "@typescript-eslint/scope-manager" "6.9.1" + "@typescript-eslint/types" "6.9.1" + "@typescript-eslint/typescript-estree" "6.9.1" + "@typescript-eslint/visitor-keys" "6.9.1" debug "^4.3.4" "@typescript-eslint/parser@^5.5.0": @@ -3095,14 +3112,6 @@ "@typescript-eslint/typescript-estree" "5.47.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3" - integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ== - dependencies: - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/visitor-keys" "4.33.0" - "@typescript-eslint/scope-manager@5.47.0": version "5.47.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.47.0.tgz#f58144a6b0ff58b996f92172c488813aee9b09df" @@ -3111,13 +3120,13 @@ "@typescript-eslint/types" "5.47.0" "@typescript-eslint/visitor-keys" "5.47.0" -"@typescript-eslint/scope-manager@5.62.0": - version "5.62.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz#d9457ccc6a0b8d6b37d0eb252a23022478c5460c" - integrity sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w== +"@typescript-eslint/scope-manager@6.9.1": + version "6.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.9.1.tgz#e96afeb9a68ad1cd816dba233351f61e13956b75" + integrity sha512-38IxvKB6NAne3g/+MyXMs2Cda/Sz+CEpmm+KLGEM8hx/CvnSRuw51i8ukfwB/B/sESdeTGet1NH1Wj7I0YXswg== dependencies: - "@typescript-eslint/types" "5.62.0" - "@typescript-eslint/visitor-keys" "5.62.0" + "@typescript-eslint/types" "6.9.1" + "@typescript-eslint/visitor-keys" "6.9.1" "@typescript-eslint/type-utils@5.47.0": version "5.47.0" @@ -3129,10 +3138,15 @@ debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" - integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== +"@typescript-eslint/type-utils@6.9.1": + version "6.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.9.1.tgz#efd5db20ed35a74d3c7d8fba51b830ecba09ce32" + integrity sha512-eh2oHaUKCK58qIeYp19F5V5TbpM52680sB4zNSz29VBQPTWIlE/hCj5P5B1AChxECe/fmZlspAWFuRniep1Skg== + dependencies: + "@typescript-eslint/typescript-estree" "6.9.1" + "@typescript-eslint/utils" "6.9.1" + debug "^4.3.4" + ts-api-utils "^1.0.1" "@typescript-eslint/types@5.47.0": version "5.47.0" @@ -3144,18 +3158,10 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f" integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== -"@typescript-eslint/typescript-estree@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" - integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA== - dependencies: - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/visitor-keys" "4.33.0" - debug "^4.3.1" - globby "^11.0.3" - is-glob "^4.0.1" - semver "^7.3.5" - tsutils "^3.21.0" +"@typescript-eslint/types@6.9.1": + version "6.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.9.1.tgz#a6cfc20db0fcedcb2f397ea728ef583e0ee72459" + integrity sha512-BUGslGOb14zUHOUmDB2FfT6SI1CcZEJYfF3qFwBeUrU6srJfzANonwRYHDpLBuzbq3HaoF2XL2hcr01c8f8OaQ== "@typescript-eslint/typescript-estree@5.47.0": version "5.47.0" @@ -3170,7 +3176,20 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@5.62.0", "@typescript-eslint/typescript-estree@^5.47.0": +"@typescript-eslint/typescript-estree@6.9.1": + version "6.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.9.1.tgz#8c77910a49a04f0607ba94d78772da07dab275ad" + integrity sha512-U+mUylTHfcqeO7mLWVQ5W/tMLXqVpRv61wm9ZtfE5egz7gtnmqVIw9ryh0mgIlkKk9rZLY3UHygsBSdB9/ftyw== + dependencies: + "@typescript-eslint/types" "6.9.1" + "@typescript-eslint/visitor-keys" "6.9.1" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.5.4" + ts-api-utils "^1.0.1" + +"@typescript-eslint/typescript-estree@^5.47.0": version "5.62.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz#7d17794b77fabcac615d6a48fb143330d962eb9b" integrity sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA== @@ -3197,13 +3216,18 @@ eslint-utils "^3.0.0" semver "^7.3.7" -"@typescript-eslint/visitor-keys@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" - integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg== +"@typescript-eslint/utils@6.9.1": + version "6.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.9.1.tgz#763da41281ef0d16974517b5f0d02d85897a1c1e" + integrity sha512-L1T0A5nFdQrMVunpZgzqPL6y2wVreSyHhKGZryS6jrEN7bD9NplVAyMryUhXsQ4TWLnZmxc2ekar/lSGIlprCA== dependencies: - "@typescript-eslint/types" "4.33.0" - eslint-visitor-keys "^2.0.0" + "@eslint-community/eslint-utils" "^4.4.0" + "@types/json-schema" "^7.0.12" + "@types/semver" "^7.5.0" + "@typescript-eslint/scope-manager" "6.9.1" + "@typescript-eslint/types" "6.9.1" + "@typescript-eslint/typescript-estree" "6.9.1" + semver "^7.5.4" "@typescript-eslint/visitor-keys@5.47.0": version "5.47.0" @@ -3221,6 +3245,19 @@ "@typescript-eslint/types" "5.62.0" eslint-visitor-keys "^3.3.0" +"@typescript-eslint/visitor-keys@6.9.1": + version "6.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.9.1.tgz#6753a9225a0ba00459b15d6456b9c2780b66707d" + integrity sha512-MUaPUe/QRLEffARsmNfmpghuQkW436DvESW+h+M52w0coICHRfD6Np9/K6PdACwnrq1HmuLl+cSPZaJmeVPkSw== + dependencies: + "@typescript-eslint/types" "6.9.1" + eslint-visitor-keys "^3.4.1" + +"@ungap/structured-clone@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" + integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== + "@vespaiach/axios-fetch-adapter@^0.3.1": version "0.3.1" resolved "https://registry.yarnpkg.com/@vespaiach/axios-fetch-adapter/-/axios-fetch-adapter-0.3.1.tgz#b0c08167bec9cc558f578a1b9ccff52ead1cf1cb" @@ -3383,7 +3420,7 @@ acorn-import-assertions@^1.7.6: resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9" integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== -acorn-jsx@^5.3.1, acorn-jsx@^5.3.2: +acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== @@ -3402,7 +3439,7 @@ acorn-walk@^7.0.0, acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== -acorn@^7.0.0, acorn@^7.1.1, acorn@^7.4.0: +acorn@^7.0.0, acorn@^7.1.1: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== @@ -3412,7 +3449,7 @@ acorn@^8.2.4, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73" integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== -acorn@^8.8.1: +acorn@^8.8.1, acorn@^8.9.0: version "8.10.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== @@ -3502,11 +3539,6 @@ ajv@^8.0.1: require-from-string "^2.0.2" uri-js "^4.2.2" -ansi-colors@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - ansi-escapes@^4.2.1, ansi-escapes@^4.3.1: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" @@ -5057,7 +5089,7 @@ debug@2.6.9, debug@^2.2.0, debug@^2.6.0, debug@^2.6.9: dependencies: ms "2.0.0" -debug@4, debug@4.3.4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: +debug@4, debug@4.3.4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -5531,13 +5563,6 @@ enhanced-resolve@^5.10.0: graceful-fs "^4.2.4" tapable "^2.2.0" -enquirer@^2.3.5: - version "2.3.6" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== - dependencies: - ansi-colors "^4.1.1" - entities@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/entities/-/entities-2.0.0.tgz#68d6084cab1b079767540d80e56a39b423e4abf4" @@ -6000,12 +6025,13 @@ eslint-scope@^7.1.1: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-utils@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" - integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== +eslint-scope@^7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" + integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== dependencies: - eslint-visitor-keys "^1.1.0" + esrecurse "^4.3.0" + estraverse "^5.2.0" eslint-utils@^3.0.0: version "3.0.0" @@ -6014,16 +6040,6 @@ eslint-utils@^3.0.0: dependencies: eslint-visitor-keys "^2.0.0" -eslint-visitor-keys@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" - integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== - -eslint-visitor-keys@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== - eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" @@ -6034,6 +6050,11 @@ eslint-visitor-keys@^3.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== +eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: + version "3.4.3" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" + integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== + eslint-webpack-plugin@^3.1.1: version "3.2.0" resolved "https://registry.yarnpkg.com/eslint-webpack-plugin/-/eslint-webpack-plugin-3.2.0.tgz#1978cdb9edc461e4b0195a20da950cf57988347c" @@ -6045,51 +6066,49 @@ eslint-webpack-plugin@^3.1.1: normalize-path "^3.0.0" schema-utils "^4.0.0" -eslint@7.32.0: - version "7.32.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" - integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== +eslint@8.52.0: + version "8.52.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.52.0.tgz#d0cd4a1fac06427a61ef9242b9353f36ea7062fc" + integrity sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg== dependencies: - "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.4.3" - "@humanwhocodes/config-array" "^0.5.0" - ajv "^6.10.0" + "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/regexpp" "^4.6.1" + "@eslint/eslintrc" "^2.1.2" + "@eslint/js" "8.52.0" + "@humanwhocodes/config-array" "^0.11.13" + "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" + "@ungap/structured-clone" "^1.2.0" + ajv "^6.12.4" chalk "^4.0.0" cross-spawn "^7.0.2" - debug "^4.0.1" + debug "^4.3.2" doctrine "^3.0.0" - enquirer "^2.3.5" escape-string-regexp "^4.0.0" - eslint-scope "^5.1.1" - eslint-utils "^2.1.0" - eslint-visitor-keys "^2.0.0" - espree "^7.3.1" - esquery "^1.4.0" + eslint-scope "^7.2.2" + eslint-visitor-keys "^3.4.3" + espree "^9.6.1" + esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" - functional-red-black-tree "^1.0.1" - glob-parent "^5.1.2" - globals "^13.6.0" - ignore "^4.0.6" - import-fresh "^3.0.0" + find-up "^5.0.0" + glob-parent "^6.0.2" + globals "^13.19.0" + graphemer "^1.4.0" + ignore "^5.2.0" imurmurhash "^0.1.4" is-glob "^4.0.0" - js-yaml "^3.13.1" + is-path-inside "^3.0.3" + js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" lodash.merge "^4.6.2" - minimatch "^3.0.4" + minimatch "^3.1.2" natural-compare "^1.4.0" - optionator "^0.9.1" - progress "^2.0.0" - regexpp "^3.1.0" - semver "^7.2.1" - strip-ansi "^6.0.0" - strip-json-comments "^3.1.0" - table "^6.0.9" + optionator "^0.9.3" + strip-ansi "^6.0.1" text-table "^0.2.0" - v8-compile-cache "^2.0.3" eslint@^8.3.0: version "8.30.0" @@ -6136,15 +6155,6 @@ eslint@^8.3.0: strip-json-comments "^3.1.0" text-table "^0.2.0" -espree@^7.3.0, espree@^7.3.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" - integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== - dependencies: - acorn "^7.4.0" - acorn-jsx "^5.3.1" - eslint-visitor-keys "^1.3.0" - espree@^9.4.0: version "9.4.1" resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.1.tgz#51d6092615567a2c2cff7833445e37c28c0065bd" @@ -6154,6 +6164,15 @@ espree@^9.4.0: acorn-jsx "^5.3.2" eslint-visitor-keys "^3.3.0" +espree@^9.6.0, espree@^9.6.1: + version "9.6.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" + integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== + dependencies: + acorn "^8.9.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.4.1" + esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" @@ -6166,6 +6185,13 @@ esquery@^1.4.0: dependencies: estraverse "^5.1.0" +esquery@^1.4.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" + integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== + dependencies: + estraverse "^5.1.0" + esrecurse@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" @@ -6611,11 +6637,6 @@ function.prototype.name@^1.1.5: es-abstract "^1.19.0" functions-have-names "^1.2.2" -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== - functions-have-names@^1.2.0: version "1.2.1" resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.1.tgz#a981ac397fa0c9964551402cdc5533d7a4d52f91" @@ -6775,13 +6796,6 @@ globals@^13.19.0: dependencies: type-fest "^0.20.2" -globals@^13.6.0, globals@^13.9.0: - version "13.10.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.10.0.tgz#60ba56c3ac2ca845cfbf4faeca727ad9dd204676" - integrity sha512-piHC3blgLGFjvOuMmWZX60f+na1lXFDhQXBf1UYp2fXPXqvEUbOhNwi6BsQ0bQishwedgnjkwv1d9zKf+MWw3g== - dependencies: - type-fest "^0.20.2" - globalthis@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" @@ -6789,7 +6803,7 @@ globalthis@^1.0.3: dependencies: define-properties "^1.1.3" -globby@^11.0.3, globby@^11.0.4, globby@^11.1.0: +globby@^11.0.4, globby@^11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== @@ -6833,6 +6847,11 @@ grapheme-splitter@^1.0.4: resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== +graphemer@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" + integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== + gzip-size@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-6.0.0.tgz#065367fd50c239c0671cbcbad5be3e2eeb10e462" @@ -7184,12 +7203,7 @@ ieee754@^1.2.1: resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - -ignore@^5.1.8, ignore@^5.2.0, ignore@^5.2.4: +ignore@^5.2.0, ignore@^5.2.4: version "5.2.4" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== @@ -9289,6 +9303,18 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" +optionator@^0.9.3: + version "0.9.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" + integrity sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg== + dependencies: + "@aashutoshrathi/word-wrap" "^1.2.3" + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + p-limit@^2.0.0, p-limit@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -10161,7 +10187,7 @@ process-nextick-args@~2.0.0: resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -progress@^2.0.0, progress@^2.0.3: +progress@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== @@ -11074,7 +11100,7 @@ regexp.prototype.flags@^1.5.0: define-properties "^1.2.0" functions-have-names "^1.2.3" -regexpp@^3.1.0, regexpp@^3.2.0: +regexpp@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== @@ -11428,7 +11454,7 @@ selfsigned@^2.1.1: dependencies: node-forge "^1" -semver@7.x, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8: +semver@7.x, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.4: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== @@ -12213,7 +12239,7 @@ symbol-tree@^3.2.4: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== -table@^6.0.9, table@^6.8.1: +table@^6.8.1: version "6.8.1" resolved "https://registry.yarnpkg.com/table/-/table-6.8.1.tgz#ea2b71359fe03b017a5fbc296204471158080bdf" integrity sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA== @@ -12450,6 +12476,11 @@ tryer@^1.0.1: resolved "https://registry.yarnpkg.com/tryer/-/tryer-1.0.1.tgz#f2c85406800b9b0f74c9f7465b81eaad241252f8" integrity sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA== +ts-api-utils@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.3.tgz#f12c1c781d04427313dbac808f453f050e54a331" + integrity sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg== + ts-jest@27.1.5: version "27.1.5" resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.5.tgz#0ddf1b163fbaae3d5b7504a1e65c914a95cff297" @@ -12778,11 +12809,6 @@ uuid@^9.0.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5" integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg== -v8-compile-cache@^2.0.3: - version "2.1.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" - integrity sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g== - v8-to-istanbul@^8.1.0: version "8.1.1" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz#77b752fd3975e31bbcef938f85e9bd1c7a8d60ed" From 91a5a755f9fb2792372a4b25188b50e7f5501522 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 19:44:35 +0900 Subject: [PATCH 6/6] fix(deps): replace dependency react-query with @tanstack/react-query 4.0.5 (#28) * fix(deps): replace dependency react-query with @tanstack/react-query 4.0.5 * refactor: use @tanstack/react-query instead of react-query --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Keith --- package.json | 2 +- src/App.tsx | 2 +- .../Header/BlockchainComp/index.tsx | 2 +- .../NftCollectionInventory/index.tsx | 2 +- .../NftCollectionOverview/index.tsx | 2 +- .../NftCollectionTransfers/index.tsx | 2 +- src/components/QueryResult/index.tsx | 7 +- src/contexts/providers/dasQuery.tsx | 2 +- src/pages/Address/AddressComp.tsx | 2 +- src/pages/Address/index.tsx | 8 +- src/pages/BlockDetail/index.tsx | 6 +- src/pages/BlockList/index.tsx | 2 +- src/pages/FeeRateTracker/index.tsx | 2 +- src/pages/Home/index.tsx | 4 +- src/pages/NervosDao/index.tsx | 10 +- src/pages/NftCollectionInfo/index.tsx | 2 +- src/pages/NftCollections/index.tsx | 2 +- src/pages/NftInfo/index.tsx | 2 +- src/pages/Script/ScriptsComp.tsx | 6 +- src/pages/Script/index.tsx | 2 +- src/pages/SimpleUDT/index.tsx | 6 +- src/pages/Tokens/index.tsx | 4 +- .../TransactionCellScript/index.tsx | 2 +- .../TransactionLite/TransactionLite.tsx | 2 +- src/pages/Transaction/index.tsx | 6 +- src/pages/TransactionList/index.tsx | 10 +- src/utils/hook.ts | 2 +- yarn.lock | 111 ++++-------------- 28 files changed, 78 insertions(+), 134 deletions(-) diff --git a/package.json b/package.json index 0cf24d042..83e787d9c 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "react-dom": "17.0.2", "react-i18next": "11.18.6", "react-outside-click-handler": "^1.3.0", - "react-query": "3.39.3", + "@tanstack/react-query": "4.0.5", "react-resize-detector": "7.1.2", "react-router": "5.3.4", "react-router-dom": "5.3.4", diff --git a/src/App.tsx b/src/App.tsx index aa0ff34fa..07cfd7290 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,5 @@ import { useMemo } from 'react' -import { QueryClient, QueryClientProvider } from 'react-query' +import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import { DefaultTheme, ThemeProvider } from 'styled-components' import Routers from './routes' import Toast from './components/Toast' diff --git a/src/components/Header/BlockchainComp/index.tsx b/src/components/Header/BlockchainComp/index.tsx index b74653b38..ab9f56812 100644 --- a/src/components/Header/BlockchainComp/index.tsx +++ b/src/components/Header/BlockchainComp/index.tsx @@ -1,5 +1,5 @@ import { useState, useLayoutEffect, FC, memo } from 'react' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { isMainnet } from '../../../utils/chain' import WhiteDropdownIcon from '../../../assets/white_dropdown.png' import BlueDropUpIcon from '../../../assets/blue_drop_up.png' diff --git a/src/components/NftCollectionInventory/index.tsx b/src/components/NftCollectionInventory/index.tsx index ab1fa3dab..e5eb39797 100644 --- a/src/components/NftCollectionInventory/index.tsx +++ b/src/components/NftCollectionInventory/index.tsx @@ -1,5 +1,5 @@ import { Link } from 'react-router-dom' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { Base64 } from 'js-base64' import { hexToBytes } from '@nervosnetwork/ckb-sdk-utils' import { useTranslation } from 'react-i18next' diff --git a/src/components/NftCollectionOverview/index.tsx b/src/components/NftCollectionOverview/index.tsx index 9f7049c25..aeee5461f 100644 --- a/src/components/NftCollectionOverview/index.tsx +++ b/src/components/NftCollectionOverview/index.tsx @@ -1,5 +1,5 @@ import { Link } from 'react-router-dom' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { Tooltip } from 'antd' import { useTranslation } from 'react-i18next' import { explorerService } from '../../services/ExplorerService' diff --git a/src/components/NftCollectionTransfers/index.tsx b/src/components/NftCollectionTransfers/index.tsx index 147942568..6c270444f 100644 --- a/src/components/NftCollectionTransfers/index.tsx +++ b/src/components/NftCollectionTransfers/index.tsx @@ -1,6 +1,6 @@ import { FC, useMemo, useState } from 'react' import { Link } from 'react-router-dom' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { Tooltip } from 'antd' import { Base64 } from 'js-base64' import { hexToBytes } from '@nervosnetwork/ckb-sdk-utils' diff --git a/src/components/QueryResult/index.tsx b/src/components/QueryResult/index.tsx index 0255cc818..d2c079695 100644 --- a/src/components/QueryResult/index.tsx +++ b/src/components/QueryResult/index.tsx @@ -1,5 +1,5 @@ import { ReactElement } from 'react' -import { UseQueryResult } from 'react-query' +import { DefinedUseQueryResult } from '@tanstack/react-query' import { LOADING_WAITING_TIME } from '../../constants/common' import Error from '../Error' import Loading from '../Loading' @@ -12,7 +12,7 @@ export function QueryResult({ errorRender, loadingRender, }: { - query: UseQueryResult + query: DefinedUseQueryResult children: (data: TData) => ReactElement delayLoading?: boolean errorRender?: (err: TError) => ReactElement @@ -22,10 +22,9 @@ export function QueryResult({ switch (query.status) { case 'error': - return errorRender ? errorRender(query.error) : + return errorRender && query.error ? errorRender(query.error) : case 'success': return children(query.data) - case 'idle': case 'loading': default: return loadingRender ? ( diff --git a/src/contexts/providers/dasQuery.tsx b/src/contexts/providers/dasQuery.tsx index 3d82f6f46..3e8c2f7f3 100644 --- a/src/contexts/providers/dasQuery.tsx +++ b/src/contexts/providers/dasQuery.tsx @@ -1,5 +1,5 @@ import { createContext, FC, useCallback, useContext, useMemo, useRef } from 'react' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { explorerService } from '../../services/ExplorerService' import type { DASAccount, DASAccountMap } from '../../services/ExplorerService/fetcher' import { unique } from '../../utils/array' diff --git a/src/pages/Address/AddressComp.tsx b/src/pages/Address/AddressComp.tsx index ff6b7ed8a..63d1d0b64 100644 --- a/src/pages/Address/AddressComp.tsx +++ b/src/pages/Address/AddressComp.tsx @@ -1,6 +1,6 @@ import axios, { AxiosResponse } from 'axios' import { useState, useEffect, FC } from 'react' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { Radio } from 'antd' import { Base64 } from 'js-base64' import { hexToBytes } from '@nervosnetwork/ckb-sdk-utils' diff --git a/src/pages/Address/index.tsx b/src/pages/Address/index.tsx index 3a96253f3..c6406fb49 100644 --- a/src/pages/Address/index.tsx +++ b/src/pages/Address/index.tsx @@ -1,5 +1,5 @@ import { useParams } from 'react-router-dom' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' import AddressHashCard from '../../components/Card/HashCard' import Content from '../../components/Content' @@ -58,15 +58,15 @@ export const Address = () => { /> - {data => } + {data => (data ? :
)} {data => ( )} diff --git a/src/pages/BlockDetail/index.tsx b/src/pages/BlockDetail/index.tsx index 21bdda1f3..b422e60ba 100644 --- a/src/pages/BlockDetail/index.tsx +++ b/src/pages/BlockDetail/index.tsx @@ -1,5 +1,5 @@ import { useParams, useLocation } from 'react-router-dom' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' import BlockHashCard from '../../components/Card/HashCard' import Content from '../../components/Content' @@ -66,8 +66,8 @@ export default () => { onPageChange={setPage} currentPage={currentPage} pageSize={pageSize} - total={data.total} - transactions={data.transactions} + total={data?.total ?? 0} + transactions={data?.transactions ?? []} /> )} diff --git a/src/pages/BlockList/index.tsx b/src/pages/BlockList/index.tsx index b99d0f578..1ae41ccab 100644 --- a/src/pages/BlockList/index.tsx +++ b/src/pages/BlockList/index.tsx @@ -1,7 +1,7 @@ import { Fragment, useMemo, FC } from 'react' import { Link, useLocation } from 'react-router-dom' import { useTranslation } from 'react-i18next' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { parseSimpleDate } from '../../utils/date' import { BlockListPanel, ContentTable, HighLightValue, BlockRewardContainer, BlockRewardPanel } from './styled' import Content from '../../components/Content' diff --git a/src/pages/FeeRateTracker/index.tsx b/src/pages/FeeRateTracker/index.tsx index 2227526e2..138339cf2 100644 --- a/src/pages/FeeRateTracker/index.tsx +++ b/src/pages/FeeRateTracker/index.tsx @@ -1,5 +1,5 @@ import { useRef, useState } from 'react' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' import styles from './styles.module.scss' import Content from '../../components/Content' diff --git a/src/pages/Home/index.tsx b/src/pages/Home/index.tsx index 7d5e7650e..69a59d640 100644 --- a/src/pages/Home/index.tsx +++ b/src/pages/Home/index.tsx @@ -1,7 +1,7 @@ import { FC, memo, useMemo, useRef } from 'react' import { useHistory } from 'react-router' import { useTranslation } from 'react-i18next' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { useResizeDetector } from 'react-resize-detector' import { HomeHeaderItemPanel, @@ -197,7 +197,7 @@ export default () => { const tipBlockNumber = useLatestBlockNumber() const blocksQuery = useQuery( - 'latest_blocks', + ['latest_blocks'], async () => { // Using the size of list pages to request will be more friendly to the data reuse of the list pages. const { data, meta } = await explorerService.api.fetchLatestBlocks(ListPageParams.PageSize) diff --git a/src/pages/NervosDao/index.tsx b/src/pages/NervosDao/index.tsx index 65a59ef9b..7650f3e18 100644 --- a/src/pages/NervosDao/index.tsx +++ b/src/pages/NervosDao/index.tsx @@ -1,6 +1,6 @@ import { useHistory } from 'react-router-dom' import { useTranslation } from 'react-i18next' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import Content from '../../components/Content' import { DaoContentPanel, DaoTabBarPanel } from './styled' import DaoTransactions from './DaoTransactions' @@ -90,16 +90,16 @@ export const NervosDao = () => { )} ) : ( - {data => } + {data => } )} diff --git a/src/pages/NftCollectionInfo/index.tsx b/src/pages/NftCollectionInfo/index.tsx index 9ef1e5a7b..0f98dea6c 100644 --- a/src/pages/NftCollectionInfo/index.tsx +++ b/src/pages/NftCollectionInfo/index.tsx @@ -1,5 +1,5 @@ import { Link, useParams, useHistory } from 'react-router-dom' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { Popover } from 'antd' import { TFunction, useTranslation } from 'react-i18next' import Content from '../../components/Content' diff --git a/src/pages/NftCollections/index.tsx b/src/pages/NftCollections/index.tsx index 46c1beaf1..9a72e5dfd 100644 --- a/src/pages/NftCollections/index.tsx +++ b/src/pages/NftCollections/index.tsx @@ -1,5 +1,5 @@ import { useHistory, useLocation } from 'react-router-dom' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' import Content from '../../components/Content' import { ListOnDesktop, ListOnMobile, isTxFilterType } from './List' diff --git a/src/pages/NftInfo/index.tsx b/src/pages/NftInfo/index.tsx index e720079fa..46846e57b 100644 --- a/src/pages/NftInfo/index.tsx +++ b/src/pages/NftInfo/index.tsx @@ -1,5 +1,5 @@ import { Link, useParams, useHistory } from 'react-router-dom' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { Tooltip } from 'antd' import { Base64 } from 'js-base64' import { hexToBytes } from '@nervosnetwork/ckb-sdk-utils' diff --git a/src/pages/Script/ScriptsComp.tsx b/src/pages/Script/ScriptsComp.tsx index 676e2f6de..ec0720bf9 100644 --- a/src/pages/Script/ScriptsComp.tsx +++ b/src/pages/Script/ScriptsComp.tsx @@ -1,6 +1,6 @@ import { useState } from 'react' import { useHistory } from 'react-router' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import camelcase from 'camelcase' import { useParams } from 'react-router-dom' import { useTranslation } from 'react-i18next' @@ -49,7 +49,7 @@ export const ScriptTransactions = ({ page, size }: { page: number; size: number {data => (
- {data.ckbTransactions && + {data?.ckbTransactions && data.ckbTransactions.map(tr => (
diff --git a/src/pages/Script/index.tsx b/src/pages/Script/index.tsx index b8c325525..1a8ba0ad2 100644 --- a/src/pages/Script/index.tsx +++ b/src/pages/Script/index.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react' import { useHistory } from 'react-router' import { useParams } from 'react-router-dom' import { Tabs } from 'antd' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' import Content from '../../components/Content' import OverviewCard, { OverviewItemData } from '../../components/Card/OverviewCard' diff --git a/src/pages/SimpleUDT/index.tsx b/src/pages/SimpleUDT/index.tsx index acfd4f42d..ed9d2866d 100644 --- a/src/pages/SimpleUDT/index.tsx +++ b/src/pages/SimpleUDT/index.tsx @@ -1,7 +1,7 @@ import { useState } from 'react' import { Link, useHistory, useLocation, useParams } from 'react-router-dom' import { useTranslation } from 'react-i18next' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { Popover } from 'antd' import SimpleUDTHashCard from '../../components/Card/HashCard' import Content from '../../components/Content' @@ -170,8 +170,8 @@ export const SimpleUDT = () => { { > {data => ( - {data.tokens.map((token, index) => ( + {data?.tokens.map((token, index) => ( ))} diff --git a/src/pages/Transaction/TransactionCellScript/index.tsx b/src/pages/Transaction/TransactionCellScript/index.tsx index 4f3960ccf..6d09df3f9 100644 --- a/src/pages/Transaction/TransactionCellScript/index.tsx +++ b/src/pages/Transaction/TransactionCellScript/index.tsx @@ -2,7 +2,7 @@ import { useState, ReactNode, useRef } from 'react' import BigNumber from 'bignumber.js' import { useTranslation } from 'react-i18next' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { explorerService } from '../../../services/ExplorerService' import { hexToUtf8 } from '../../../utils/string' import { diff --git a/src/pages/Transaction/TransactionComp/TransactionLite/TransactionLite.tsx b/src/pages/Transaction/TransactionComp/TransactionLite/TransactionLite.tsx index c070856c1..63cc59de4 100644 --- a/src/pages/Transaction/TransactionComp/TransactionLite/TransactionLite.tsx +++ b/src/pages/Transaction/TransactionComp/TransactionLite/TransactionLite.tsx @@ -1,6 +1,6 @@ /* eslint-disable react/no-array-index-key */ import { FC } from 'react' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { useParams } from 'react-router-dom' import BigNumber from 'bignumber.js' import { useTranslation } from 'react-i18next' diff --git a/src/pages/Transaction/index.tsx b/src/pages/Transaction/index.tsx index 1ce404445..72ff7925e 100644 --- a/src/pages/Transaction/index.tsx +++ b/src/pages/Transaction/index.tsx @@ -1,5 +1,5 @@ import { useParams } from 'react-router-dom' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' import TransactionHashCard from '../../components/Card/HashCard' import Content from '../../components/Content' @@ -42,11 +42,11 @@ export default () => { {layout === Professional ? ( - {transaction => } + {transaction => (transaction ? :
)} ) : ( - {transaction => } + {transaction => } )} diff --git a/src/pages/TransactionList/index.tsx b/src/pages/TransactionList/index.tsx index 9da30ab34..9e61a3e4e 100644 --- a/src/pages/TransactionList/index.tsx +++ b/src/pages/TransactionList/index.tsx @@ -1,7 +1,7 @@ import { FC, ReactNode } from 'react' import { Link, useLocation } from 'react-router-dom' import { useTranslation } from 'react-i18next' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { parseSimpleDate } from '../../utils/date' import Content from '../../components/Content' import { shannonToCkb } from '../../utils/util' @@ -237,7 +237,11 @@ const TransactionsPanel: FC<{ type: TxStatus }> = ({ type }) => { type === 'confirmed' ? s === 'height' || s === 'capacity' : s === 'capacity' || s === 'time' || s === 'fee', ) - const query = useQuery( + const query = useQuery< + { transactions: Transaction[]; total: number }, + unknown, + { transactions: Transaction[]; total: number } + >( [`${type}-transactions`, type, currentPage, pageSize, sortBy, orderBy] as const, async ({ queryKey }) => { const [, type] = queryKey @@ -261,7 +265,7 @@ const TransactionsPanel: FC<{ type: TxStatus }> = ({ type }) => { initialData: state?.type === 'TransactionListPage' && state.createTime + stateStaleTime > Date.now() ? state.transactionsDataWithFirstPage - : undefined, + : { total: 0, transactions: [] }, }, ) diff --git a/src/utils/hook.ts b/src/utils/hook.ts index c0a970fa4..11dd9783a 100644 --- a/src/utils/hook.ts +++ b/src/utils/hook.ts @@ -8,7 +8,7 @@ import { systemScripts, } from '@nervosnetwork/ckb-sdk-utils' import { useHistory, useLocation } from 'react-router-dom' -import { useQuery } from 'react-query' +import { useQuery } from '@tanstack/react-query' import { useResizeDetector } from 'react-resize-detector' import { interval, share } from 'rxjs' import { AppCachedKeys } from '../constants/cache' diff --git a/yarn.lock b/yarn.lock index 06a6d220d..695c394fa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1374,20 +1374,13 @@ dependencies: regenerator-runtime "^0.13.11" -"@babel/runtime@^7.5.5", "@babel/runtime@^7.7.6": +"@babel/runtime@^7.7.6": version "7.10.5" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.10.5.tgz#303d8bd440ecd5a491eae6117fd3367698674c5c" integrity sha512-otddXKhdNn7d0ptoFRHtMLa8LqDxLYwTjB4nYgM1yy5N6gU/MUf8zqyyLltCH3yAVitBzmwK4us+DD0l/MauAg== dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@^7.6.2", "@babel/runtime@^7.7.2": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.6.tgz#6a1ef59f838debd670421f8c7f2cbb8da9751580" - integrity sha512-t9wi7/AW6XtKahAe20Yw0/mMljKq0B1r2fPdvaAdV/KPDZewFXdaaa6K7lxmZBZ8FBNpCiAT6iHPmd6QO9bKfQ== - dependencies: - regenerator-runtime "^0.13.4" - "@babel/template@^7.18.10", "@babel/template@^7.3.3": version "7.18.10" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.18.10.tgz#6f9134835970d1dbf0835c0d100c9f38de0c5e71" @@ -2533,6 +2526,20 @@ "@svgr/plugin-svgo" "^5.5.0" loader-utils "^2.0.0" +"@tanstack/query-core@^4.0.0-beta.1": + version "4.36.1" + resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-4.36.1.tgz#79f8c1a539d47c83104210be2388813a7af2e524" + integrity sha512-DJSilV5+ytBP1FbFcEJovv4rnnm/CokuVvrBEtW/Va9DvuJ3HksbXUJEpI0aV1KtuL4ZoO9AVE6PyNLzF7tLeA== + +"@tanstack/react-query@4.0.5": + version "4.0.5" + resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-4.0.5.tgz#4597ac03394ddfa6ad8b5e1beb6282468623d398" + integrity sha512-tIggVlhoFevVpY/LkZroPmrERFHN8tw4aZLtgwSArzHmMJ03WQcaNvbbHy6GERidXtaMdUz+IeQryrE7cO7WPQ== + dependencies: + "@tanstack/query-core" "^4.0.0-beta.1" + "@types/use-sync-external-store" "^0.0.3" + use-sync-external-store "^1.2.0" + "@testing-library/dom@^8.0.0": version "8.20.0" resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.20.0.tgz#914aa862cef0f5e89b98cc48e3445c4c921010f6" @@ -3014,6 +3021,11 @@ resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.2.tgz#fc25ad9943bcac11cceb8168db4f275e0e72e756" integrity sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg== +"@types/use-sync-external-store@^0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz#b6725d5f4af24ace33b36fafd295136e75509f43" + integrity sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA== + "@types/ws@^8.5.1": version "8.5.3" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.3.tgz#7d25a1ffbecd3c4f2d35068d0b283c037003274d" @@ -4116,11 +4128,6 @@ bfj@^7.0.2: hoopy "^0.1.4" tryer "^1.0.1" -big-integer@^1.6.16: - version "1.6.51" - resolved "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686" - integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg== - big.js@^5.2.2: version "5.2.2" resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" @@ -4229,20 +4236,6 @@ braces@^3.0.2, braces@~3.0.2: dependencies: fill-range "^7.0.1" -broadcast-channel@^3.4.1: - version "3.7.0" - resolved "https://registry.npmjs.org/broadcast-channel/-/broadcast-channel-3.7.0.tgz#2dfa5c7b4289547ac3f6705f9c00af8723889937" - integrity sha512-cIAKJXAxGJceNZGTZSBzMxzyOn72cVgPnKx4dc6LRjQgbaJUQqhy5rzL3zbMxkMWsGKkv2hSFkPRMEXfoMZ2Mg== - dependencies: - "@babel/runtime" "^7.7.2" - detect-node "^2.1.0" - js-sha3 "0.8.0" - microseconds "0.2.0" - nano-time "1.0.0" - oblivious-set "1.0.0" - rimraf "3.0.2" - unload "2.2.0" - brorand@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" @@ -5249,11 +5242,6 @@ detect-node@^2.0.4: resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.4.tgz#014ee8f8f669c5c58023da64b8179c083a28c46c" integrity sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw== -detect-node@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1" - integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g== - detect-port-alt@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/detect-port-alt/-/detect-port-alt-1.1.6.tgz#24707deabe932d4a3cf621302027c2b266568275" @@ -8235,11 +8223,6 @@ js-sdsl@^4.1.4: resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.2.0.tgz#278e98b7bea589b8baaf048c20aeb19eb7ad09d0" integrity sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ== -js-sha3@0.8.0: - version "0.8.0" - resolved "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" - integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== - "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -8682,14 +8665,6 @@ map-obj@^4.1.0: resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== -match-sorter@^6.0.2: - version "6.3.1" - resolved "https://registry.npmjs.org/match-sorter/-/match-sorter-6.3.1.tgz#98cc37fda756093424ddf3cbc62bfe9c75b92bda" - integrity sha512-mxybbo3pPNuA+ZuCUhm5bwNkXrJTbsk5VWbR5wiwz/GC6LIiegBGn2w3O08UG/jdbYLinw51fSQ5xNU1U3MgBw== - dependencies: - "@babel/runtime" "^7.12.5" - remove-accents "0.4.2" - mathml-tag-names@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" @@ -8768,11 +8743,6 @@ micromatch@4.0.5, micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.5: braces "^3.0.2" picomatch "^2.3.1" -microseconds@0.2.0: - version "0.2.0" - resolved "https://registry.npmjs.org/microseconds/-/microseconds-0.2.0.tgz#233b25f50c62a65d861f978a4a4f8ec18797dc39" - integrity sha512-n7DHHMjR1avBbSpsTBj6fmMGh2AGrifVV4e+WYc3Q9lO+xnSZ3NyhcBND3vzzatt05LFhoKFRxrIyklmLlUtyA== - mime-db@1.52.0, "mime-db@>= 1.43.0 < 2": version "1.52.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" @@ -8925,13 +8895,6 @@ multimatch@^5.0.0: arrify "^2.0.1" minimatch "^3.0.4" -nano-time@1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/nano-time/-/nano-time-1.0.0.tgz#b0554f69ad89e22d0907f7a12b0993a5d96137ef" - integrity sha512-flnngywOoQ0lLQOTRNexn2gGSNuM9bKj9RZAWSzhQ+UJYaAFG9bac4DW9VHjUAzrOaIcajHybCTHe/bkvozQqA== - dependencies: - big-integer "^1.6.16" - nanoassert@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/nanoassert/-/nanoassert-2.0.0.tgz#a05f86de6c7a51618038a620f88878ed1e490c09" @@ -9222,11 +9185,6 @@ object.values@^1.1.5, object.values@^1.1.6: define-properties "^1.1.4" es-abstract "^1.20.4" -oblivious-set@1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/oblivious-set/-/oblivious-set-1.0.0.tgz#c8316f2c2fb6ff7b11b6158db3234c49f733c566" - integrity sha512-z+pI07qxo4c2CulUHCDf9lcqDlMSo72N/4rLUpRXf6fu+q8vjt8y0xS+Tlf8NTJDdTXHbdeO1n3MlbctwEoXZw== - observable-hooks@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/observable-hooks/-/observable-hooks-4.2.3.tgz#69e3353caafd7887ad9030bd440b053304e8d2d1" @@ -10814,15 +10772,6 @@ react-outside-click-handler@^1.3.0: object.values "^1.1.0" prop-types "^15.7.2" -react-query@3.39.3: - version "3.39.3" - resolved "https://registry.yarnpkg.com/react-query/-/react-query-3.39.3.tgz#4cea7127c6c26bdea2de5fb63e51044330b03f35" - integrity sha512-nLfLz7GiohKTJDuT4us4X3h/8unOh+00MLb2yJoGTPjxKs2bc1iDhkNx2bd5MKklXnOD3NrVZ+J2UXujA5In4g== - dependencies: - "@babel/runtime" "^7.5.5" - broadcast-channel "^3.4.1" - match-sorter "^6.0.2" - react-refresh@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.11.0.tgz#77198b944733f0f1f1a90e791de4541f9f074046" @@ -11134,11 +11083,6 @@ relateurl@^0.2.7: resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" integrity sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog== -remove-accents@0.4.2: - version "0.4.2" - resolved "https://registry.npmjs.org/remove-accents/-/remove-accents-0.4.2.tgz#0a43d3aaae1e80db919e07ae254b285d9e1c7bb5" - integrity sha512-7pXIJqJOq5tFgG1A2Zxti3Ht8jJF337m4sowbuHsW30ZnkQFnDzy9qBNhgzX8ZLW4+UBcXiiR7SwR6pokHsxiA== - renderkid@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-3.0.0.tgz#5fd823e4d6951d37358ecc9a58b1f06836b6268a" @@ -11279,7 +11223,7 @@ rimraf@2, rimraf@^2.5.1: dependencies: glob "^7.1.3" -rimraf@3.0.2, rimraf@^3.0.0, rimraf@^3.0.2: +rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== @@ -12710,14 +12654,6 @@ universalify@^2.0.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== -unload@2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/unload/-/unload-2.2.0.tgz#ccc88fdcad345faa06a92039ec0f80b488880ef7" - integrity sha512-B60uB5TNBLtN6/LsgAf3udH9saB5p7gqJwcFfbOEZ8BcBHnGwCf6G/TGiEqkRAxX7zAFIUtzdrXQSdL3Q/wqNA== - dependencies: - "@babel/runtime" "^7.6.2" - detect-node "^2.0.4" - unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" @@ -12774,6 +12710,11 @@ url-parse@^1.5.3: querystringify "^2.1.1" requires-port "^1.0.0" +use-sync-external-store@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" + integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== + util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"