Skip to content

Commit

Permalink
feat(frontend): set default to token to usdc
Browse files Browse the repository at this point in the history
  • Loading branch information
immutablegoblin authored and boriskubrik committed Oct 25, 2023
1 parent cd7c87f commit 6e0052d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/frontend/src/hooks/useDefaultTokens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { useFormContext } from 'react-hook-form';
import { useTokens } from 'src/hooks/useTokens';
import { SwapFormKeyHelper } from 'src/providers/SwapFormProvider';

const DEFAULT_TO_TOKEN_SYMBOL = 'USDC';

const useDefaultTokens = () => {
const { setValue } = useFormContext();
const fromTokenKey = SwapFormKeyHelper.getTokenKey('from');
Expand All @@ -17,7 +19,7 @@ const useDefaultTokens = () => {

useEffect(() => {
if (toTokens.length > 1) {
setValue(toTokenKey, toTokens[1].symbol);
setValue(toTokenKey, DEFAULT_TO_TOKEN_SYMBOL);
}
}, [toTokens, setValue]);
};
Expand Down

0 comments on commit 6e0052d

Please sign in to comment.