Skip to content

Commit

Permalink
fix: code review
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsimao committed Jan 28, 2025
1 parent a338895 commit de93542
Show file tree
Hide file tree
Showing 5 changed files with 270 additions and 351 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useLingui } from '@lingui/react';
import { mergeProps } from '@react-aria/utils';
import { useMutation } from '@tanstack/react-query';
import Big from 'big.js';
import { useEffect, useMemo } from 'react';
import { useEffect, useMemo, useState } from 'react';
import { useDebounceValue } from 'usehooks-ts';
import { Address } from 'viem';
import { useAccount, usePublicClient } from 'wagmi';
Expand Down Expand Up @@ -98,6 +98,7 @@ const BobBridgeForm = ({
const initialToken = useMemo(() => Ether.onChain(bridgeChainId), [bridgeChainId]);

const symbol = symbolProp || initialToken.symbol;
const [prevSymbol, setPrevSymbol] = useState(symbol);

const [amount, setAmount] = useDebounceValue('', 300);

Expand Down Expand Up @@ -425,10 +426,10 @@ const BobBridgeForm = ({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [direction]);

useEffect(() => {
form.resetForm({ values: { ...initialValues, [BRIDGE_ASSET]: symbol } });
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [symbol]);
if (symbol !== prevSymbol) {
setPrevSymbol(symbol);
form.setFieldValue(BRIDGE_ASSET, symbol, true);
}

const handleChangeSymbol = (currency: Currency) => {
onChangeSymbol?.(currency.symbol as string);
Expand Down
83 changes: 0 additions & 83 deletions apps/evm/src/connect-ui/component/ConnectWallet/ConnectWallet.tsx

This file was deleted.

Loading

0 comments on commit de93542

Please sign in to comment.