@@ -66,25 +66,30 @@ const TransferModalBody = (
6666
6767 const { balance, isLoading : isLoadingBalance } = useBalance (
6868 sourceChainName ,
69- isDeposit
69+ isDeposit ,
70+ transferInfo . token . symbol
7071 ) ;
7172
7273 const { getChainLogo } = useManager ( ) ;
7374 const { tx } = useTx ( sourceChainName ) ;
7475
7576 const availableAmount = useMemo ( ( ) => {
76- if ( ! isDeposit ) return transferToken . priceDisplayAmount ?? 0 ;
77- if ( isLoading ) return 0 ;
77+ if ( ! isDeposit ) return transferToken . available ?? 0 ;
78+ if ( isLoadingBalance ) return 0 ;
79+
80+ console . log ( 'transferInfo.token' , transferInfo . token )
7881
7982 return new BigNumber (
80- convRawToDispAmount ( transferToken . symbol , balance ?. amount || '0' )
83+ convRawToDispAmount ( transferInfo . token . symbol , balance ?. amount || '0' )
8184 ) . toNumber ( ) ;
8285 // eslint-disable-next-line react-hooks/exhaustive-deps
83- } , [ isDeposit , isLoading , transferToken ] ) ;
86+ } , [ isDeposit , isLoading , transferToken . symbol , balance ?. amount , transferInfo . token . symbol ,
87+ isLoadingBalance
88+ ] ) ;
8489
85- const dollarValue = new BigNumber ( inputValue )
86- . multipliedBy ( prices [ symbolToDenom ( transferToken . symbol ) ] )
87- . decimalPlaces ( 2 )
90+ const dollarValue = new BigNumber ( 1 )
91+ . multipliedBy ( prices [ symbolToDenom ( transferToken . symbol , transferInfo . sourceChainName ) ] )
92+ . decimalPlaces ( 6 )
8893 . toNumber ( ) ;
8994
9095 useEffect ( ( ) => {
@@ -145,7 +150,6 @@ const TransferModalBody = (
145150
146151 const sourceChain = useMemo ( ( ) => {
147152 return {
148- symbol : sourceChainInfo . chain_name . toUpperCase ( ) ,
149153 name : sourceChainInfo . pretty_name ,
150154 address : sourceAddress ?? '' ,
151155 imgSrc : getChainLogo ( sourceChainName ) ?? '' ,
@@ -212,7 +216,7 @@ const TransferModalBody = (
212216 return (
213217 < AssetWithdrawTokens
214218 isDropdown = { false }
215- fromSymbol = { sourceChain . symbol }
219+ fromSymbol = { transferInfo . token . symbol }
216220 fromName = { sourceChain . name }
217221 fromAddress = { sourceChain . address }
218222 fromImgSrc = { sourceChain . imgSrc }
@@ -246,7 +250,7 @@ const TransferModalBody = (
246250} ;
247251
248252export const RowTransferModal = ( props : IProps ) => {
249- const { modalControl } = props ;
253+ const { modalControl, transferInfo } = props ;
250254 const [ inputValue , setInputValue ] = useState ( '' ) ;
251255 const [ isLoading , setIsLoading ] = useState ( false ) ;
252256
@@ -258,7 +262,7 @@ export const RowTransferModal = (props: IProps) => {
258262 return (
259263 < BasicModal
260264 isOpen = { modalControl . isOpen }
261- title = "Deposit"
265+ title = { transferInfo . type }
262266 onClose = { ( ) => closeModal ( ) }
263267 >
264268 < TransferModalBody
0 commit comments