From 084979aa3c94e71e3575de6eb8decf47e0b77dc3 Mon Sep 17 00:00:00 2001 From: Sunny Luo Date: Tue, 21 Feb 2023 18:22:51 +0800 Subject: [PATCH] fix: webview header in modal (#2599) --- packages/kit/src/hooks/useOpenBlockBrowser.ts | 17 ++++++----------- .../kit/src/views/Wallet/AssetsList/index.tsx | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/packages/kit/src/hooks/useOpenBlockBrowser.ts b/packages/kit/src/hooks/useOpenBlockBrowser.ts index 4f3d1ebf463..cdb60bc155c 100644 --- a/packages/kit/src/hooks/useOpenBlockBrowser.ts +++ b/packages/kit/src/hooks/useOpenBlockBrowser.ts @@ -2,7 +2,6 @@ import { useCallback, useMemo } from 'react'; import { useIntl } from 'react-intl'; -import { useIsVerticalLayout } from '@onekeyhq/components'; import type { Network } from '@onekeyhq/engine/src/types/network'; import { IMPL_FIL } from '@onekeyhq/shared/src/engine/engineConsts'; import platformEnv from '@onekeyhq/shared/src/platformEnv'; @@ -64,10 +63,6 @@ export default function useOpenBlockBrowser( const networks = useNetworks(); - const isVertical = useIsVerticalLayout(); - - const modalMode = !isVertical; - const hasAvailable = useMemo(() => { if (!network) return false; const currentNetwork = networks.find((x) => x.id === network.id); @@ -82,11 +77,11 @@ export default function useOpenBlockBrowser( url, title ?? intl.formatMessage({ id: 'transaction__transaction_details' }), { - modalMode, + modalMode: true, }, ); }, - [intl, modalMode, network], + [intl, network], ); const openAddressDetails = useCallback( @@ -97,11 +92,11 @@ export default function useOpenBlockBrowser( url, title ?? intl.formatMessage({ id: 'transaction__transaction_details' }), { - modalMode, + modalMode: true, }, ); }, - [intl, modalMode, network], + [intl, network], ); const openBlockDetails = useCallback( @@ -112,11 +107,11 @@ export default function useOpenBlockBrowser( url, title ?? intl.formatMessage({ id: 'transaction__transaction_details' }), { - modalMode, + modalMode: true, }, ); }, - [intl, modalMode, network], + [intl, network], ); return { diff --git a/packages/kit/src/views/Wallet/AssetsList/index.tsx b/packages/kit/src/views/Wallet/AssetsList/index.tsx index c1fed2360eb..19067dde8ff 100644 --- a/packages/kit/src/views/Wallet/AssetsList/index.tsx +++ b/packages/kit/src/views/Wallet/AssetsList/index.tsx @@ -12,6 +12,7 @@ import { } from '@onekeyhq/components'; import { Tabs } from '@onekeyhq/components/src/CollapsibleTabView'; import type { FlatListProps } from '@onekeyhq/components/src/FlatList'; +import type { Token } from '@onekeyhq/engine/src/types/token'; import type { EVMDecodedItem } from '@onekeyhq/engine/src/vaults/impl/evm/decoder/types'; import { EVMDecodedTxType } from '@onekeyhq/engine/src/vaults/impl/evm/decoder/types'; import { HomeRoutes } from '@onekeyhq/kit/src/routes/types'; @@ -34,7 +35,6 @@ import TokenCell from './TokenCell'; import type { SimplifiedToken } from '../../../store/reducers/tokens'; import type { NativeStackNavigationProp } from '@react-navigation/native-stack'; -import { Token } from '@onekeyhq/engine/src/types/token'; type NavigationProps = NativeStackNavigationProp< RootRoutesParams,