Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-schrammel committed Oct 16, 2024
1 parent fb63c76 commit 12099e0
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/components/gas/GasSpeedButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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]
);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -459,7 +455,7 @@ const GasSpeedButton = ({
isAnchoredToRight
isMenuPrimaryAction
onPressActionSheet={handlePressActionSheet}
options={menuConfig.menuItems}
options={speedOptions}
useActionSheetFallback={false}
wrapNativeComponent={false}
>
Expand All @@ -470,14 +466,12 @@ const GasSpeedButton = ({

return (
<ContextMenuButton
activeOpacity={0}
enableContextMenu
isAnchoredToRight
isMenuPrimaryAction
menuConfig={menuConfig}
onPressMenuItem={handlePressMenuItem}
useActionSheetFallback={false}
wrapNativeComponent={false}
>
{pager}
</ContextMenuButton>
Expand All @@ -489,6 +483,7 @@ const GasSpeedButton = ({
handlePressActionSheet,
handlePressMenuItem,
menuConfig,
speedOptions,
rawColorForAsset,
selectedGasFeeOption,
showGasOptions,
Expand Down

0 comments on commit 12099e0

Please sign in to comment.