@@ -4,7 +4,6 @@ import cstyles from "../common/Common.module.css";
44import {
55 ToAddrClass ,
66 SendPageStateClass ,
7- AddressBookEntryClass ,
87 ValueTransferClass ,
98 ServerChainNameEnum ,
109} from "../appstate" ;
@@ -36,7 +35,6 @@ const Send: React.FC<SendProps> = ({
3635 info,
3736 totalBalance,
3837 readOnly,
39- addressBook,
4038 fetchError,
4139 valueTransfers,
4240 currentWallet,
@@ -56,7 +54,7 @@ const Send: React.FC<SendProps> = ({
5654 const [ shieldFee , setShieldFee ] = useState < number > ( 0 ) ;
5755
5856 useEffect ( ( ) => {
59- // set somePending as well here when I know there is something new in ValueTransfers
57+ // set somePending as well here when I know there is something new in ValueTransfers
6058 const pending : number =
6159 valueTransfers . length > 0 ? valueTransfers . filter ( ( vt : ValueTransferClass ) => vt . confirmations >= 0 && vt . confirmations < 3 ) . length : 0 ;
6260 setAnyPending ( pending > 0 ) ;
@@ -194,14 +192,6 @@ const Send: React.FC<SendProps> = ({
194192 setModalIsOpen ( false ) ;
195193 } ;
196194
197- const getLabelAddressBook = ( addr : string ) => {
198- // Find the addr in addresses
199- const label : AddressBookEntryClass | undefined = addressBook . find ( ( ab : AddressBookEntryClass ) => ab . address === addr ) ;
200- const labelStr : string = label ? ` [ ${ label . label } ]` : "" ;
201-
202- return labelStr ;
203- } ;
204-
205195 const calculateSendFee = async ( ) : Promise < { fee : number , error : string , spendable : number } > => {
206196 let _fee : number = 0 ;
207197 let _error : string = '' ;
@@ -323,30 +313,24 @@ const Send: React.FC<SendProps> = ({
323313 < div className = { [ styles . horizontalcontainer ] . join ( " " ) } >
324314 < div className = { cstyles . containermarginleft } >
325315 < ScrollPaneTop offsetHeight = { 260 } >
326- { [ sendPageState . toaddr ] . map ( ( toaddr : ToAddrClass , index : number ) => {
327- return (
328- < ToAddrBox
329- key = { index }
330- toaddr = { toaddr }
331- zecPrice = { info . zecPrice }
332- updateToField = { updateToField }
333- fromAmount = { totalAmountAvailable }
334- fromAmountDefault = { totalBalance . totalSpendableBalance }
335- setMaxAmount = { setMaxAmount }
336- setSendButtonEnabled = { setSendButtonEnabled }
337- sendFee = { sendFee }
338- sendFeeError = { sendFeeError }
339- fetchSendFeeAndErrorAndSpendable = { fetchSendFeeAndErrorAndSpendable }
340- setSendFee = { setSendFee }
341- setSendFeeError = { setSendFeeError }
342- setTotalAmountAvailable = { setTotalAmountAvailable }
343- label = { getLabelAddressBook ( toaddr . to ) }
344- serverChainName = { currentWallet ? currentWallet . chain_name : ServerChainNameEnum . mainChainName }
345- block = { info . latestBlock >= info . walletHeight ? info . latestBlock : info . walletHeight }
346- currencyName = { info . currencyName }
347- />
348- ) ;
349- } ) }
316+ < ToAddrBox
317+ toaddr = { sendPageState . toaddr }
318+ zecPrice = { info . zecPrice }
319+ updateToField = { updateToField }
320+ fromAmount = { totalAmountAvailable }
321+ fromAmountDefault = { totalBalance . totalSpendableBalance }
322+ setMaxAmount = { setMaxAmount }
323+ setSendButtonEnabled = { setSendButtonEnabled }
324+ sendFee = { sendFee }
325+ sendFeeError = { sendFeeError }
326+ fetchSendFeeAndErrorAndSpendable = { fetchSendFeeAndErrorAndSpendable }
327+ setSendFee = { setSendFee }
328+ setSendFeeError = { setSendFeeError }
329+ setTotalAmountAvailable = { setTotalAmountAvailable }
330+ serverChainName = { currentWallet ? currentWallet . chain_name : ServerChainNameEnum . mainChainName }
331+ block = { info . latestBlock >= info . walletHeight ? info . latestBlock : info . walletHeight }
332+ currencyName = { info . currencyName }
333+ />
350334 </ ScrollPaneTop >
351335 </ div >
352336
0 commit comments