From 6e0052dcd016a207a0806094688c4b224cbd11b6 Mon Sep 17 00:00:00 2001 From: immutablegoblin <112887817+immutablegoblin@users.noreply.github.com> Date: Wed, 25 Oct 2023 12:16:17 +0300 Subject: [PATCH] feat(frontend): set default to token to usdc --- packages/frontend/src/hooks/useDefaultTokens.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/hooks/useDefaultTokens.tsx b/packages/frontend/src/hooks/useDefaultTokens.tsx index 79e7d780..ebe33c7a 100644 --- a/packages/frontend/src/hooks/useDefaultTokens.tsx +++ b/packages/frontend/src/hooks/useDefaultTokens.tsx @@ -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'); @@ -17,7 +19,7 @@ const useDefaultTokens = () => { useEffect(() => { if (toTokens.length > 1) { - setValue(toTokenKey, toTokens[1].symbol); + setValue(toTokenKey, DEFAULT_TO_TOKEN_SYMBOL); } }, [toTokens, setValue]); };