[Wallet - Token management] Extend transactions UI component

Backend #13241

Closes #12375
This commit is contained in:
Alexandra Betouni 2024-01-18 20:19:07 +02:00
parent 50e6011bcf
commit 7e3ae8dd7a
2 changed files with 21 additions and 1 deletions

View File

@ -26,6 +26,9 @@ SplitView {
readonly property string sender: "0xfB8131c260749c7835a08ccBdb64728De432858E"
readonly property string recipient: "0x3fb81384583b3910BB14Cc72582E8e8a56E83ae9"
readonly property bool isNFT: ctrlIsNft.checked
readonly property bool isCommunityAssetViaAirdrop: isCommunityAssetViaAirdrop.checked
readonly property string communityName: "Doodles"
readonly property string communityImageUrl: Style.png("collectibles/HappyMeow")
readonly property string tokenID: "4981676894159712808201908443964193325271219637660871887967796332739046670337"
readonly property string tokenAddress: "0xdeadbeef"
readonly property string tokenInAddress: "0xdeadbeef-00"
@ -119,6 +122,12 @@ SplitView {
text: "Is NFT"
}
CheckBox {
id: isCommunityAssetViaAirdrop
checked: true
text: "Is Community Asset Via Airdrop"
}
Label {
Layout.topMargin: 10
Layout.fillWidth: true

View File

@ -60,6 +60,7 @@ StatusListItem {
readonly property double outFiatValue: isModelDataValid && isMultiTransaction ? rootStore.getFiatValue(outCryptoValue, modelData.outSymbol, currentCurrency): 0.0
readonly property double feeCryptoValue: 0.0 // TODO fill when bridge data is implemented
readonly property double feeFiatValue: 0.0 // TODO fill when bridge data is implemented
readonly property string communityName: isModelDataValid ? modelData.communityName : ""
readonly property string networkColor: isModelDataValid ? rootStore.getNetworkColor(modelData.chainId) : ""
readonly property string networkName: isModelDataValid ? rootStore.getNetworkFullName(modelData.chainId) : ""
readonly property string networkNameIn: isMultiTransaction ? rootStore.getNetworkFullName(modelData.chainIdIn) : ""
@ -67,6 +68,7 @@ StatusListItem {
readonly property string addressNameTo: isModelDataValid ? walletRootStore.getNameForAddress(modelData.recipient) : ""
readonly property string addressNameFrom: isModelDataValid ? walletRootStore.getNameForAddress(modelData.sender) : ""
readonly property bool isNFT: isModelDataValid && modelData.isNFT
readonly property bool isCommunityAssetViaAirdrop: isModelDataValid && modelData.isCommunityAssetViaAirdrop
readonly property string transactionValue: {
if (!isModelDataValid) {
@ -106,6 +108,14 @@ StatusListItem {
}
}
readonly property string communityImage: {
if (!isModelDataValid || !root.isCommunityAssetViaAirdrop)
return ""
if (root.isCommunityAssetViaAirdrop) {
return modelData.communityImageUrl ? modelData.communityImageUrl : ""
}
}
readonly property string inTokenImage: isModelDataValid ? Constants.tokenIcon(modelData.inSymbol) : ""
readonly property string toAddress: !!addressNameTo ?
@ -660,7 +670,8 @@ StatusListItem {
return ""
}
return getSubtitle(root.showAllAccounts)
return root.isCommunityAssetViaAirdrop ? qsTr("%1 (community asset) from %2 %3 via %4").arg(transactionValue).arg("<img src='" + root.communityImage + "'
width='18' height='18' </img>").arg(communityName).arg(networkName) : getSubtitle(root.showAllAccounts)
}
statusListItemSubTitle.maximumLoadingStateWidth: 400
statusListItemSubTitle.customColor: Theme.palette.directColor1