Skip to content

Commit

Permalink
feat(@desktop/wallet): Collectible Details balance tag
Browse files Browse the repository at this point in the history
fixes #13809
  • Loading branch information
Khushboo-dev-cpp committed Apr 2, 2024
1 parent 4af2a97 commit d5f425c
Show file tree
Hide file tree
Showing 8 changed files with 378 additions and 355 deletions.
62 changes: 61 additions & 1 deletion storybook/pages/CollectibleDetailViewPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,23 @@ import utils 1.0
SplitView {
id: root

QtObject {
function isValidURL(url) {
return true
}

Component.onCompleted: {
Utils.globalUtilsInst = this
}
Component.onDestruction: {
Utils.globalUtilsInst = {}
}
}

QtObject {
id: d

readonly property QtObject collectiblesModel: WalletCollectiblesModel {
readonly property QtObject collectiblesModel: ManageCollectiblesModel {
Component.onCompleted: {
d.refreshCurrentCollectible()
}
Expand All @@ -34,6 +47,15 @@ SplitView {
}

readonly property QtObject transactionsModel: WalletTransactionsModel{}

readonly property string addressesSelected: {
let supportedAddresses = ""
for (let i =0; i< accountsRepeater.count; i++) {
if (accountsRepeater.itemAt(i).checked && accountsRepeater.itemAt(i).visible)
supportedAddresses += accountsRepeater.itemAt(i).address + ":"
}
return supportedAddresses
}
}

SplitView {
Expand Down Expand Up @@ -62,6 +84,7 @@ SplitView {
collectible: d.currentCollectible
isCollectibleLoading: isLoadingCheckbox.checked
activityModel: d.transactionsModel
addressFilters: d.addressesSelected
rootStore: QtObject {
readonly property string currentCurrency: "EUR"

Expand All @@ -83,6 +106,26 @@ SplitView {
}

readonly property bool showAllAccounts: true

function getExplorerUrl(networkShortName, contractAddress, tokenId) {
let link = Constants.networkExplorerLinks.etherscan
if (networkShortName === Constants.networkShortChainNames.mainnet) {
return "%1/nft/%2/%3".arg(link).arg(contractAddress).arg(tokenId)
}
else {
return "%1/token/%2?a=%3".arg(link).arg(contractAddress).arg(tokenId)
}
}

function getOpenSeaCollectionUrl(networkShortName, contractAddress) {
let baseLink = root.areTestNetworksEnabled ? Constants.openseaExplorerLinks.testnetLink : Constants.openseaExplorerLinks.mainnetLink
return "%1/assets/%2/%3".arg(baseLink).arg(networkShortName).arg(contractAddress)
}

function getOpenSeaCollectibleUrl(networkShortName, contractAddress, tokenId) {
let baseLink = root.areTestNetworksEnabled ? Constants.openseaExplorerLinks.testnetLink : Constants.openseaExplorerLinks.mainnetLink
return "%1/assets/%2/%3/%4".arg(baseLink).arg(networkShortName).arg(contractAddress).arg(tokenId)
}
}
communitiesStore: QtObject {
function getCommunityDetailsAsJson(communityId) {
Expand Down Expand Up @@ -127,6 +170,23 @@ SplitView {
text: "isLoading"
checked: false
}
ColumnLayout {
Layout.fillWidth: true
Text {
text: "select account(s)"
}
Repeater {
id: accountsRepeater
model: WalletAccountsModel {}
delegate: CheckBox {
property string address: model.address
checked: true
visible: index<2
width: parent.width
text: name
}
}
}
}
}
}
Expand Down
Loading

0 comments on commit d5f425c

Please # to comment.