Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix keyboard dismisses option to copy contract address or view on etherscan #5908

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 18 additions & 20 deletions src/__swaps__/screens/Swap/components/CoinRow.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import React, { memo, useCallback, useMemo } from 'react';
import { BalancePill } from '@/__swaps__/screens/Swap/components/BalancePill';
import { CoinRowButton } from '@/__swaps__/screens/Swap/components/CoinRowButton';
import { AddressOrEth, ParsedSearchAsset } from '@/__swaps__/types/assets';
import { ChainId } from '@/__swaps__/types/chains';
import { SearchAsset } from '@/__swaps__/types/search';
import { ButtonPressAnimation } from '@/components/animations';
import { ContextMenuButton } from '@/components/context-menu';
import { Box, Column, Columns, HitSlop, Inline, Text } from '@/design-system';
import { CoinRowButton } from '@/__swaps__/screens/Swap/components/CoinRowButton';
import { BalancePill } from '@/__swaps__/screens/Swap/components/BalancePill';
import { toggleFavorite } from '@/resources/favorites';
import { SwapCoinIcon } from './SwapCoinIcon';
import { ethereumUtils, haptics, showActionSheetWithOptions } from '@/utils';
import { ContextMenuButton, OnPressMenuItemEventObject } from 'react-native-ios-context-menu';
import { IS_ANDROID } from '@/env';
import { startCase } from 'lodash';
import { setClipboard } from '@/hooks/useClipboard';
import { RainbowNetworks } from '@/networks';
import * as i18n from '@/languages';
import { ETH_ADDRESS, BASE_DEGEN_ADDRESS, DEGEN_CHAIN_DEGEN_ADDRESS } from '@/references';
import { AddressOrEth, ParsedSearchAsset } from '@/__swaps__/types/assets';
import { RainbowNetworks } from '@/networks';
import { BASE_DEGEN_ADDRESS, DEGEN_CHAIN_DEGEN_ADDRESS, ETH_ADDRESS } from '@/references';
import { toggleFavorite } from '@/resources/favorites';
import { userAssetsStore } from '@/state/assets/userAssets';
import { SearchAsset } from '@/__swaps__/types/search';
import { ChainId } from '@/__swaps__/types/chains';
import { ethereumUtils, haptics, showActionSheetWithOptions } from '@/utils';
import { startCase } from 'lodash';
import React, { memo, useCallback, useMemo } from 'react';
import { GestureResponderEvent } from 'react-native';
import { OnPressMenuItemEventObject } from 'react-native-ios-context-menu';
import { SwapCoinIcon } from './SwapCoinIcon';

export const COIN_ROW_WITH_PADDING_HEIGHT = 56;

Expand Down Expand Up @@ -257,13 +257,11 @@ const InfoButton = ({ address, chainId }: { address: string; chainId: ChainId })

return (
<ContextMenuButton
isMenuPrimaryAction
// @ts-expect-error Types of property 'menuItems' are incompatible
menuConfig={menuConfig}
onPress={IS_ANDROID ? onPressAndroid : undefined}
menuItems={menuConfig.menuItems}
menuTitle={menuConfig.menuTitle}
onPressAndroid={onPressAndroid}
onPressMenuItem={handlePressMenuItem}
useActionSheetFallback={false}
wrapNativeComponent={false}
testID={`coin-row-info-button-${address}`}
>
<CoinRowButton icon="􀅳" outline size="icon 14px" />
</ContextMenuButton>
Expand Down
6 changes: 0 additions & 6 deletions src/__swaps__/screens/Swap/components/SearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,6 @@ export const SearchInput = ({
animatedProps={searchInputValue}
onChangeText={output ? onOutputSearchQueryChange : onInputSearchQueryChange}
onBlur={() => {
runOnUI(() => {
if (isSearchFocused.value) {
handleExitSearchWorklet();
}
})();

if (isSearchFocused.value) {
if (output) {
if (useSwapsStore.getState().outputSearchQuery !== '') {
Expand Down
23 changes: 12 additions & 11 deletions src/__swaps__/screens/Swap/components/TokenList/TokenToBuyList.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
import { FlashList } from '@shopify/flash-list';
import React, { memo, useCallback, useMemo } from 'react';
import Animated, { runOnUI, useAnimatedProps, useAnimatedStyle, withTiming } from 'react-native-reanimated';
import { analyticsV2 } from '@/analytics';
import { AnimatedTextIcon } from '@/components/AnimatedComponents/AnimatedTextIcon';
import { TIMING_CONFIGS } from '@/components/animations/animationConfigs';
import { Box, Inline, Stack, Text, TextIcon, useColorMode } from '@/design-system';
import { palettes } from '@/design-system/color/palettes';
import * as i18n from '@/languages';
import { userAssetsStore } from '@/state/assets/userAssets';
import { swapsStore } from '@/state/swaps/swapsStore';
import { COIN_ROW_WITH_PADDING_HEIGHT, CoinRow } from '@/__swaps__/screens/Swap/components/CoinRow';
import { ListEmpty } from '@/__swaps__/screens/Swap/components/TokenList/ListEmpty';
import { AssetToBuySectionId, useSearchCurrencyLists } from '@/__swaps__/screens/Swap/hooks/useSearchCurrencyLists';
Expand All @@ -18,7 +7,18 @@ import { SearchAsset } from '@/__swaps__/types/search';
import { SwapAssetType } from '@/__swaps__/types/swap';
import { parseSearchAsset } from '@/__swaps__/utils/assets';
import { getChainColorWorklet, getStandardizedUniqueIdWorklet } from '@/__swaps__/utils/swaps';
import { analyticsV2 } from '@/analytics';
import { AnimatedTextIcon } from '@/components/AnimatedComponents/AnimatedTextIcon';
import { TIMING_CONFIGS } from '@/components/animations/animationConfigs';
import { Box, Inline, Stack, Text, TextIcon, useColorMode } from '@/design-system';
import { palettes } from '@/design-system/color/palettes';
import * as i18n from '@/languages';
import { userAssetsStore } from '@/state/assets/userAssets';
import { swapsStore } from '@/state/swaps/swapsStore';
import { DEVICE_WIDTH } from '@/utils/deviceUtils';
import { FlashList } from '@shopify/flash-list';
import React, { memo, useCallback, useMemo } from 'react';
import Animated, { runOnUI, useAnimatedProps, useAnimatedStyle, withTiming } from 'react-native-reanimated';
import { EXPANDED_INPUT_HEIGHT, FOCUSED_INPUT_HEIGHT } from '../../constants';
import { ChainSelection } from './ChainSelection';

Expand Down Expand Up @@ -126,6 +126,7 @@ export const TokenToBuyList = () => {
return (
<Box style={{ height: EXPANDED_INPUT_HEIGHT - 77, width: DEVICE_WIDTH - 24 }}>
<FlashList
keyboardShouldPersistTaps="always"
ListEmptyComponent={<ListEmpty output />}
ListFooterComponent={<Animated.View style={[animatedListPadding, { width: '100%' }]} />}
ListHeaderComponent={<ChainSelection output />}
Expand Down
Loading