From 12099e0cbe79a4ed792aa29b79c785497ed8ad23 Mon Sep 17 00:00:00 2001 From: gregs Date: Wed, 16 Oct 2024 03:18:57 -0300 Subject: [PATCH] lint --- src/components/gas/GasSpeedButton.tsx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/components/gas/GasSpeedButton.tsx b/src/components/gas/GasSpeedButton.tsx index 2506342a029..6fc390dd7bb 100644 --- a/src/components/gas/GasSpeedButton.tsx +++ b/src/components/gas/GasSpeedButton.tsx @@ -29,8 +29,8 @@ import { EthCoinIcon } from '../coin-icon/EthCoinIcon'; import { ChainId } from '@/chains/types'; import { chainsGasSpeeds } from '@/chains'; import { ThemeContextProps, useTheme } from '@/theme'; -import { OnPressMenuItemEventObject } from 'react-native-ios-context-menu'; import { ParsedAddressAsset } from '@/entities'; +import { GasSpeed } from '@/__swaps__/types/gas'; const { GAS_EMOJIS, GAS_ICONS, GasSpeedOrder, CUSTOM, URGENT, NORMAL, FAST, getGasLabel } = gasUtils; @@ -361,9 +361,7 @@ const GasSpeedButton = ({ }, [chainId, crossChainServiceTime, inputCurrency, navigate, outputCurrency]); const handlePressMenuItem = useCallback( - ({ nativeEvent: { actionKey } }: OnPressMenuItemEventObject) => { - handlePressSpeedOption(actionKey); - }, + ({ nativeEvent: { actionKey } }: { nativeEvent: { actionKey: GasSpeed } }) => handlePressSpeedOption(actionKey), [handlePressSpeedOption] ); @@ -393,8 +391,6 @@ const GasSpeedButton = ({ const menuConfig = useMemo(() => { const menuOptions = speedOptions?.map(gasOption => { - if (IS_ANDROID) return gasOption; - const totalGwei = add(gasFeeParamsBySpeed[gasOption]?.maxBaseFee?.gwei, gasFeeParamsBySpeed[gasOption]?.maxPriorityFeePerGas?.gwei); const estimatedGwei = add(currentBlockParams?.baseFeePerGas?.gwei, gasFeeParamsBySpeed[gasOption]?.maxPriorityFeePerGas?.gwei); @@ -459,7 +455,7 @@ const GasSpeedButton = ({ isAnchoredToRight isMenuPrimaryAction onPressActionSheet={handlePressActionSheet} - options={menuConfig.menuItems} + options={speedOptions} useActionSheetFallback={false} wrapNativeComponent={false} > @@ -470,14 +466,12 @@ const GasSpeedButton = ({ return ( {pager} @@ -489,6 +483,7 @@ const GasSpeedButton = ({ handlePressActionSheet, handlePressMenuItem, menuConfig, + speedOptions, rawColorForAsset, selectedGasFeeOption, showGasOptions,