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