From 57defa1e42230c28f80b67c3382c6342b4579354 Mon Sep 17 00:00:00 2001 From: He1DAr Date: Thu, 13 Jul 2023 12:17:29 -0400 Subject: [PATCH 1/3] fix: search bar crash --- .../BlockList/MicroblockListItem.tsx | 6 +-- .../[hash]/tx-lists/MicroblockTxsList.tsx | 2 +- .../ContractCall/SelectedContractView.tsx | 2 +- .../txid/[txid]/Cards/ContractDetailsCard.tsx | 2 +- .../txid/[txid]/TxDetails/ContractName.tsx | 4 +- .../balances/token-asset-list-item.tsx | 2 +- src/components/contract-source.tsx | 2 +- src/components/function-summary/value.tsx | 2 +- src/components/links.tsx | 40 +++++++++++-------- src/components/stacking.tsx | 4 +- src/components/transaction-list.tsx | 4 +- .../search/items/address-result-item.tsx | 2 +- .../search/items/result-item-wrapper.tsx | 10 +++-- src/features/search/use-search.ts | 1 + 14 files changed, 48 insertions(+), 35 deletions(-) diff --git a/src/app/components/BlockList/MicroblockListItem.tsx b/src/app/components/BlockList/MicroblockListItem.tsx index bda80579e..a62cc91e9 100644 --- a/src/app/components/BlockList/MicroblockListItem.tsx +++ b/src/app/components/BlockList/MicroblockListItem.tsx @@ -1,5 +1,5 @@ import { toRelativeTime } from '@/common/utils'; -import { MicroblockLink } from '@/components/links'; +import { MicroBlockLink } from '@/components/links'; import { Circle, Flex, Icon, Stack } from '@/ui/components'; import { Caption, Text, Title } from '@/ui/typography'; import { useColorMode } from '@chakra-ui/react'; @@ -28,7 +28,7 @@ export const MicroblockListItem: React.FC<{ - + {hash} - + Microblock diff --git a/src/app/microblock/[hash]/tx-lists/MicroblockTxsList.tsx b/src/app/microblock/[hash]/tx-lists/MicroblockTxsList.tsx index 56a3ce4b1..a932ba439 100644 --- a/src/app/microblock/[hash]/tx-lists/MicroblockTxsList.tsx +++ b/src/app/microblock/[hash]/tx-lists/MicroblockTxsList.tsx @@ -36,7 +36,7 @@ export const MicroblockTxsList: FC = memo(({ microblockH leftContent={{ title: ( - <TxLink txid={txId}>{truncateMiddle(txId)}</TxLink> + <TxLink txId={txId}>{truncateMiddle(txId)}</TxLink> ), subtitle: null, diff --git a/src/app/sandbox/components/ContractCall/SelectedContractView.tsx b/src/app/sandbox/components/ContractCall/SelectedContractView.tsx index 990e17c45..6ee40044a 100644 --- a/src/app/sandbox/components/ContractCall/SelectedContractView.tsx +++ b/src/app/sandbox/components/ContractCall/SelectedContractView.tsx @@ -46,7 +46,7 @@ const ContractInfo: FC = ({ contract: { contract_id, abi } }) return (
( - + = ({ contract - + + {tx.contract_call.contract_id} @@ -40,7 +40,7 @@ export const ContractName: FC<{ + {tx.smart_contract.contract_id} diff --git a/src/components/balances/token-asset-list-item.tsx b/src/components/balances/token-asset-list-item.tsx index 16fdd1322..81891983f 100644 --- a/src/components/balances/token-asset-list-item.tsx +++ b/src/components/balances/token-asset-list-item.tsx @@ -71,7 +71,7 @@ export const TokenAssetListItem: React.FC = ({ ? ftMetadata?.symbol || getTicker(asset).toUpperCase() : getTicker(asset).toUpperCase()} - + ( - + - + {principal} {getPrettyClarityValueType(arg.type)} diff --git a/src/components/links.tsx b/src/components/links.tsx index 1a798065a..47d063bb0 100644 --- a/src/components/links.tsx +++ b/src/components/links.tsx @@ -10,22 +10,30 @@ export const ExplorerLink = forwardRef(({ href, ...rest }, ref) return ; }); -export const TxLink: React.FC<{ txid: string }> = React.memo(({ txid, ...rest }) => { - return ; -}); +export const TxLink = forwardRef & { txId: string }, 'a'>( + ({ txId, ...rest }, ref) => { + return ; + } +); -export const MicroblockLink: React.FC<{ hash: string }> = React.memo(({ hash, ...rest }) => { - return ; -}); +export const MicroBlockLink = forwardRef & { hash: string }, 'a'>( + ({ hash, ...rest }, ref) => { + return ; + } +); -export const BlockLink: React.FC<{ hash: string }> = React.memo(({ hash, ...rest }) => { - return ; -}); +export const BlockLink = forwardRef & { hash: string }, 'a'>( + ({ hash, ...rest }, ref) => { + return ; + } +); -export const AddressLink: React.FC<{ principal: string }> = React.memo(({ principal, ...rest }) => { - return principal.includes('.') ? ( - - ) : ( - - ); -}); +export const AddressLink = forwardRef & { principal: string }, 'a'>( + ({ principal, ...rest }, ref) => { + return principal.includes('.') ? ( + + ) : ( + + ); + } +); diff --git a/src/components/stacking.tsx b/src/components/stacking.tsx index e0cc0c47e..7de4fca5e 100644 --- a/src/components/stacking.tsx +++ b/src/components/stacking.tsx @@ -71,7 +71,7 @@ export const StackingPercentage = ({ balances, address }: any) => { ~{blocksUntilUnlocked.toLocaleString(undefined, { maximumFractionDigits: 2 })}{' '} blocks remaining - + View Stacking transaction @@ -83,7 +83,7 @@ export const StackingPercentage = ({ balances, address }: any) => { Completed at #{unlockBlock} - + View Stacking transaction diff --git a/src/components/transaction-list.tsx b/src/components/transaction-list.tsx index 37b73bd48..9f3d68f2d 100644 --- a/src/components/transaction-list.tsx +++ b/src/components/transaction-list.tsx @@ -19,8 +19,8 @@ const Item: React.FC< { tx: MempoolTransaction | Transaction; isLast?: boolean; principal?: string } & BoxProps > = React.memo(({ tx, principal, ...rest }) => { return ( - - + + diff --git a/src/features/search/items/address-result-item.tsx b/src/features/search/items/address-result-item.tsx index 52ba30dcc..a26e9124d 100644 --- a/src/features/search/items/address-result-item.tsx +++ b/src/features/search/items/address-result-item.tsx @@ -25,7 +25,7 @@ export const AddressResultItem: React.FC = ({ result }) const { data: stxBalance } = useQuery( ['stx-balance', principal], () => accountsApi.getAccountStxBalance({ principal }) as Promise, - { staleTime: 3 * 60 * 1000 } + { staleTime: 3 * 60 * 1000, suspense: false } ); const colorMode = useColorMode().colorMode; return ( diff --git a/src/features/search/items/result-item-wrapper.tsx b/src/features/search/items/result-item-wrapper.tsx index 34aa2a73b..28e39095b 100644 --- a/src/features/search/items/result-item-wrapper.tsx +++ b/src/features/search/items/result-item-wrapper.tsx @@ -1,8 +1,12 @@ import { Flex, FlexProps } from '@/ui/components'; import React, { FC } from 'react'; +import { forwardRef } from '@chakra-ui/react'; +import Link, { LinkProps } from 'next/link'; +import { useGlobalContext } from '@/common/context/useAppContext'; +import { buildUrl } from '@/app/common/utils/buildUrl'; -export const ResultItemWrapper: FC = ({ children, ...rest }) => ( - +export const ResultItemWrapper = forwardRef(({ children, ...rest }, ref) => ( + = ({ children, ...rest }) => ( -); +)); diff --git a/src/features/search/use-search.ts b/src/features/search/use-search.ts index d28e4c2ef..64927f55a 100644 --- a/src/features/search/use-search.ts +++ b/src/features/search/use-search.ts @@ -75,6 +75,7 @@ export const useSearchQuery = (id: string) => { retry: false, refetchOnWindowFocus: false, staleTime: 1 * 60 * 1000, + suspense: false, } ); }; From 98d8f3170e13f91ee73d21d0f3f2b6f6e11a6693 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 13 Jul 2023 18:04:35 +0000 Subject: [PATCH 2/3] chore(release): 1.110.4 ## [1.110.4](https://github.com/hirosystems/explorer/compare/v1.110.3...v1.110.4) (2023-07-13) ### Bug Fixes * search bar crash ([57defa1](https://github.com/hirosystems/explorer/commit/57defa1e42230c28f80b67c3382c6342b4579354)) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d312176b1..7bb9513e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.110.4](https://github.com/hirosystems/explorer/compare/v1.110.3...v1.110.4) (2023-07-13) + + +### Bug Fixes + +* search bar crash ([57defa1](https://github.com/hirosystems/explorer/commit/57defa1e42230c28f80b67c3382c6342b4579354)) + ## [1.110.3](https://github.com/hirosystems/explorer/compare/v1.110.2...v1.110.3) (2023-07-06) From 79efb8d13f7669a4359c4b3418320ca609e4f1ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Jul 2023 17:44:59 +0000 Subject: [PATCH 3/3] chore(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] --- pnpm-lock.yaml | 43 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6074c84c2..0fca2b869 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,5 +1,9 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + overrides: eslint: 7.16.0 bn.js: 5.1.3 @@ -11171,6 +11175,35 @@ packages: - supports-color dev: true + /eslint-module-utils@2.7.4(@typescript-eslint/parser@4.28.5)(eslint-import-resolver-node@0.3.6)(eslint@7.16.0): + resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: '*' + eslint-import-resolver-node: '*' + eslint-import-resolver-typescript: '*' + eslint-import-resolver-webpack: '*' + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + eslint: + optional: true + eslint-import-resolver-node: + optional: true + eslint-import-resolver-typescript: + optional: true + eslint-import-resolver-webpack: + optional: true + dependencies: + '@typescript-eslint/parser': 4.28.5(eslint@7.16.0)(typescript@4.7.4) + debug: 3.2.7 + eslint: 7.16.0 + eslint-import-resolver-node: 0.3.6 + transitivePeerDependencies: + - supports-color + dev: true + /eslint-module-utils@2.7.4(@typescript-eslint/parser@5.48.0)(eslint-import-resolver-node@0.3.6)(eslint-import-resolver-typescript@3.5.2)(eslint@7.16.0): resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} engines: {node: '>=4'} @@ -11248,7 +11281,7 @@ packages: doctrine: 2.1.0 eslint: 7.16.0 eslint-import-resolver-node: 0.3.6 - eslint-module-utils: 2.7.4(@typescript-eslint/parser@5.48.0)(eslint-import-resolver-node@0.3.6)(eslint-import-resolver-typescript@3.5.2)(eslint@7.16.0) + eslint-module-utils: 2.7.4(@typescript-eslint/parser@4.28.5)(eslint-import-resolver-node@0.3.6)(eslint@7.16.0) find-up: 2.1.0 has: 1.0.3 is-core-module: 2.11.0 @@ -15641,7 +15674,7 @@ packages: levn: 0.3.0 prelude-ls: 1.1.2 type-check: 0.3.2 - word-wrap: 1.2.3 + word-wrap: 1.2.4 dev: true /optionator@0.9.1: @@ -15653,7 +15686,7 @@ packages: levn: 0.4.1 prelude-ls: 1.2.1 type-check: 0.4.0 - word-wrap: 1.2.3 + word-wrap: 1.2.4 dev: true /os-browserify@0.3.0: @@ -19472,8 +19505,8 @@ packages: bs58check: 2.1.2 dev: false - /word-wrap@1.2.3: - resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==} + /word-wrap@1.2.4: + resolution: {integrity: sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==} engines: {node: '>=0.10.0'} dev: true