@@ -22,6 +22,8 @@ import { setIsModalOpen, setModalStep } from '@/store/modal'
2222const DAILY_LIMIT_ERROR = 'Daily wrap limit exceeded'
2323const DAILY_LIMIT_ERROR_TYPE = 'Forbidden'
2424
25+ import { useForm , FormProvider } from 'react-hook-form'
26+
2527export const MainModal = ( {
2628 success,
2729 failed,
@@ -36,6 +38,9 @@ export const MainModal = ({
3638 const modalRef = useRef < HTMLDivElement > ( null )
3739 const tariAccount = useTariAccountStore ( ( s ) => s . tariAccount )
3840 const { address : ethAddress , chain, isConnected } = useConnection ( )
41+ const methods = useForm ( {
42+ mode : 'onChange' ,
43+ } )
3944
4045 const { getUserBackendBridgeTxs } = useBridgeTransaction ( )
4146 const { bridgeToEthereum } = useBridgeToEthereum ( )
@@ -138,14 +143,16 @@ export const MainModal = ({
138143 }
139144
140145 return (
141- < div className = "fixed inset-0 z-50 flex items-center justify-center bg-black/50" >
142- < section
143- ref = { modalRef }
144- className = "w-full max-w-md mx-4 bg-[#E0DFDE] shadow-[0px_4px_74px_0px_rgba(0,0,0,0.15)] backdrop-blur-[54px] rounded-3xl overflow-hidden flex flex-col justify-center items-center"
145- onClick = { ( e ) => e . stopPropagation ( ) }
146- >
147- { renderModal ( ) }
148- </ section >
149- </ div >
146+ < FormProvider { ...methods } >
147+ < div className = "fixed inset-0 z-50 flex items-center justify-center bg-black/50" >
148+ < section
149+ ref = { modalRef }
150+ className = "w-full max-w-md mx-4 bg-[#E0DFDE] shadow-[0px_4px_74px_0px_rgba(0,0,0,0.15)] backdrop-blur-[54px] rounded-3xl overflow-hidden flex flex-col justify-center items-center"
151+ onClick = { ( e ) => e . stopPropagation ( ) }
152+ >
153+ { renderModal ( ) }
154+ </ section >
155+ </ div >
156+ </ FormProvider >
150157 )
151158}
0 commit comments