|
|
|
@ -71,6 +71,8 @@ export default class ConfirmApproveContent extends Component { |
|
|
|
|
assetName: PropTypes.string, |
|
|
|
|
tokenId: PropTypes.string, |
|
|
|
|
assetStandard: PropTypes.string, |
|
|
|
|
isSetApproveForAll: PropTypes.bool, |
|
|
|
|
setApproveForAllArg: PropTypes.bool, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
state = { |
|
|
|
@ -184,7 +186,7 @@ export default class ConfirmApproveContent extends Component { |
|
|
|
|
|
|
|
|
|
renderERC721OrERC1155PermissionContent() { |
|
|
|
|
const { t } = this.context; |
|
|
|
|
const { origin, toAddress, isContract } = this.props; |
|
|
|
|
const { origin, toAddress, isContract, isSetApproveForAll } = this.props; |
|
|
|
|
|
|
|
|
|
const titleTokenDescription = this.getTitleTokenDescription(); |
|
|
|
|
|
|
|
|
@ -201,7 +203,9 @@ export default class ConfirmApproveContent extends Component { |
|
|
|
|
{t('approvedAsset')}: |
|
|
|
|
</div> |
|
|
|
|
<div className="confirm-approve-content__medium-text"> |
|
|
|
|
{titleTokenDescription} |
|
|
|
|
{isSetApproveForAll |
|
|
|
|
? `${t('allOfYour', [titleTokenDescription])} ` |
|
|
|
|
: titleTokenDescription} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div className="flex-row"> |
|
|
|
@ -299,12 +303,19 @@ export default class ConfirmApproveContent extends Component { |
|
|
|
|
|
|
|
|
|
renderDataContent() { |
|
|
|
|
const { t } = this.context; |
|
|
|
|
const { data } = this.props; |
|
|
|
|
const { data, isSetApproveForAll, setApproveForAllArg } = this.props; |
|
|
|
|
return ( |
|
|
|
|
<div className="flex-column"> |
|
|
|
|
<div className="confirm-approve-content__small-text"> |
|
|
|
|
{t('functionApprove')} |
|
|
|
|
{isSetApproveForAll |
|
|
|
|
? t('functionSetApprovalForAll') |
|
|
|
|
: t('functionApprove')} |
|
|
|
|
</div> |
|
|
|
|
{isSetApproveForAll && setApproveForAllArg !== undefined ? ( |
|
|
|
|
<div className="confirm-approve-content__small-text"> |
|
|
|
|
{t('parameters')}: {setApproveForAllArg} |
|
|
|
|
</div> |
|
|
|
|
) : null} |
|
|
|
|
<div className="confirm-approve-content__small-text confirm-approve-content__data__data-block"> |
|
|
|
|
{data} |
|
|
|
|
</div> |
|
|
|
@ -509,6 +520,41 @@ export default class ConfirmApproveContent extends Component { |
|
|
|
|
return titleTokenDescription; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
renderTitle() { |
|
|
|
|
const { t } = this.context; |
|
|
|
|
const { isSetApproveForAll, setApproveForAllArg } = this.props; |
|
|
|
|
const titleTokenDescription = this.getTitleTokenDescription(); |
|
|
|
|
|
|
|
|
|
let title; |
|
|
|
|
|
|
|
|
|
if (isSetApproveForAll) { |
|
|
|
|
title = t('approveAllTokensTitle', [titleTokenDescription]); |
|
|
|
|
if (setApproveForAllArg === false) { |
|
|
|
|
title = t('revokeAllTokensTitle', [titleTokenDescription]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return title || t('allowSpendToken', [titleTokenDescription]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
renderDescription() { |
|
|
|
|
const { t } = this.context; |
|
|
|
|
const { isContract, isSetApproveForAll, setApproveForAllArg } = this.props; |
|
|
|
|
const grantee = isContract |
|
|
|
|
? t('contract').toLowerCase() |
|
|
|
|
: t('account').toLowerCase(); |
|
|
|
|
|
|
|
|
|
let description = t('trustSiteApprovePermission', [grantee]); |
|
|
|
|
|
|
|
|
|
if (isSetApproveForAll && setApproveForAllArg === false) { |
|
|
|
|
description = t('revokeApproveForAllDescription', [ |
|
|
|
|
grantee, |
|
|
|
|
this.getTitleTokenDescription(), |
|
|
|
|
]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return description; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
|
const { t } = this.context; |
|
|
|
|
const { |
|
|
|
@ -534,8 +580,6 @@ export default class ConfirmApproveContent extends Component { |
|
|
|
|
} = this.props; |
|
|
|
|
const { showFullTxDetails } = this.state; |
|
|
|
|
|
|
|
|
|
const titleTokenDescription = this.getTitleTokenDescription(); |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div |
|
|
|
|
className={classnames('confirm-approve-content', { |
|
|
|
@ -575,14 +619,10 @@ export default class ConfirmApproveContent extends Component { |
|
|
|
|
</Box> |
|
|
|
|
</Box> |
|
|
|
|
<div className="confirm-approve-content__title"> |
|
|
|
|
{t('allowSpendToken', [titleTokenDescription])} |
|
|
|
|
{this.renderTitle()} |
|
|
|
|
</div> |
|
|
|
|
<div className="confirm-approve-content__description"> |
|
|
|
|
{t('trustSiteApprovePermission', [ |
|
|
|
|
isContract |
|
|
|
|
? t('contract').toLowerCase() |
|
|
|
|
: t('account').toLowerCase(), |
|
|
|
|
])} |
|
|
|
|
{this.renderDescription()} |
|
|
|
|
</div> |
|
|
|
|
<Box className="confirm-approve-content__address-display-content"> |
|
|
|
|
<Box display={DISPLAY.FLEX}> |
|
|
|
|