fix(@wallet): display network short name for collectible

fixes #8850
This commit is contained in:
Anthony Laibe 2023-02-07 09:23:44 +01:00 committed by Anthony Laibe
parent 9e23f78180
commit 8ba10ce6b0
3 changed files with 14 additions and 14 deletions

View File

@ -11,7 +11,7 @@ QtObject:
View* = ref object of QObject
delegate: io_interface.AccessInterface
networkName: string
networkShortName: string
networkColor: string
networkIconUrl: string
@ -47,14 +47,14 @@ QtObject:
proc load*(self: View) =
self.delegate.viewDidLoad()
proc getNetworkName(self: View): QVariant {.slot.} =
return newQVariant(self.networkName)
proc getNetworkShortName(self: View): QVariant {.slot.} =
return newQVariant(self.networkShortName)
proc networkNameChanged(self: View) {.signal.}
proc networkShortNameChanged(self: View) {.signal.}
QtProperty[QVariant] networkName:
read = getNetworkName
notify = networkNameChanged
QtProperty[QVariant] networkShortName:
read = getNetworkShortName
notify = networkShortNameChanged
proc getNetworkColor(self: View): QVariant {.slot.} =
return newQVariant(self.networkColor)
@ -177,9 +177,9 @@ QtObject:
self.delegate.update(collectionSlug, id)
proc setData*(self: View, collection: collectible_dto.CollectionDto, collectible: collectible_dto.CollectibleDto, network: network_dto.NetworkDto) =
if (self.networkName != network.chainName):
self.networkName = network.chainName
self.networkNameChanged()
if (self.networkShortName != network.shortName):
self.networkShortName = network.shortName
self.networkShortNameChanged()
if (self.networkColor != network.chainColor):
self.networkColor = network.chainColor

View File

@ -15,7 +15,7 @@ ColumnLayout {
property alias primaryText: collectibleName.text
property string secondaryText
property bool isNarrowMode
property string networkName
property string networkShortName
property string networkColor
property string networkIconURL
@ -84,9 +84,9 @@ ColumnLayout {
InformationTag {
id: networkTag
readonly property bool isNetworkValid: networkName !== ""
readonly property bool isNetworkValid: networkShortName !== ""
image.source: isNetworkValid && networkIconURL !== "" ? Style.svg("tiny/" + networkIconURL) : ""
tagPrimaryLabel.text: isNetworkValid ? networkName : "---"
tagPrimaryLabel.text: isNetworkValid ? networkShortName : "---"
tagPrimaryLabel.color: isNetworkValid ? networkColor : "black"
visible: isNetworkValid
}

View File

@ -28,7 +28,7 @@ Item {
primaryText: currentCollectible.collectionName
secondaryText: currentCollectible.id
isNarrowMode: root.isNarrowMode
networkName: currentCollectible.networkName
networkShortName: currentCollectible.networkShortName
networkColor: currentCollectible.networkColor
networkIconURL: currentCollectible.networkIconUrl
}