Bugfix - Add Recipient name on Send Fund's second step modal (#2255)
* Set recipient name if it is selected from addressBook * Remove unnecesary console.log + some improvements
This commit is contained in:
parent
2afbc827c9
commit
404e54e42d
|
@ -42,6 +42,7 @@ const { nativeCoin } = getNetworkInfo()
|
|||
|
||||
export type ReviewTxProp = {
|
||||
recipientAddress: string
|
||||
recipientName?: string
|
||||
amount: string
|
||||
txRecipient: string
|
||||
token: string
|
||||
|
@ -218,6 +219,7 @@ const ReviewSendFundsTx = ({ onClose, onPrev, tx }: ReviewTxProps): React.ReactE
|
|||
<Col xs={12}>
|
||||
<EthHashInfo
|
||||
hash={tx.recipientAddress}
|
||||
name={tx.recipientName}
|
||||
showCopyBtn
|
||||
showAvatar
|
||||
explorerUrl={getExplorerInfo(tx.recipientAddress)}
|
||||
|
|
|
@ -69,6 +69,7 @@ const useStyles = makeStyles(styles)
|
|||
export type SendFundsTx = {
|
||||
amount?: string
|
||||
recipientAddress?: string
|
||||
name?: string
|
||||
token?: string
|
||||
txType?: string
|
||||
tokenSpendingLimit?: SpendingLimit
|
||||
|
@ -133,11 +134,12 @@ const SendFunds = ({
|
|||
|
||||
let tokenSpendingLimit
|
||||
const handleSubmit = (values) => {
|
||||
const submitValues = values
|
||||
const submitValues = { ...values }
|
||||
// If the input wasn't modified, there was no mutation of the recipientAddress
|
||||
if (!values.recipientAddress) {
|
||||
submitValues.recipientAddress = selectedEntry?.address
|
||||
}
|
||||
submitValues.recipientName = selectedEntry?.name
|
||||
onReview({ ...submitValues, tokenSpendingLimit })
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue