2024-02-26 02:32:59 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
|
|
|
import Storybook 1.0
|
|
|
|
|
2024-05-22 08:13:39 +00:00
|
|
|
import AppLayouts.Communities.stores 1.0 as CommunitiesStores
|
2024-02-26 02:32:59 +00:00
|
|
|
import AppLayouts.Wallet 1.0
|
|
|
|
import AppLayouts.Wallet.stores 1.0 as WalletStores
|
|
|
|
import AppLayouts.Wallet.views.collectibles 1.0
|
|
|
|
|
|
|
|
import StatusQ.Core.Utils 0.1
|
|
|
|
|
|
|
|
import shared.controls 1.0
|
2024-05-22 08:13:39 +00:00
|
|
|
import shared.stores 1.0 as SharedStores
|
2024-02-26 02:32:59 +00:00
|
|
|
|
|
|
|
import Models 1.0
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
SplitView {
|
|
|
|
id: root
|
|
|
|
|
2024-03-27 21:49:46 +00:00
|
|
|
QtObject {
|
|
|
|
function isValidURL(url) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
Utils.globalUtilsInst = this
|
|
|
|
}
|
|
|
|
Component.onDestruction: {
|
|
|
|
Utils.globalUtilsInst = {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-26 02:32:59 +00:00
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
|
2024-03-27 21:49:46 +00:00
|
|
|
readonly property QtObject collectiblesModel: ManageCollectiblesModel {
|
2024-02-26 02:32:59 +00:00
|
|
|
Component.onCompleted: {
|
|
|
|
d.refreshCurrentCollectible()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
property var currentCollectible
|
|
|
|
|
|
|
|
function refreshCurrentCollectible() {
|
|
|
|
currentCollectible = ModelUtils.get(collectiblesModel, collectibleComboBox.currentIndex)
|
|
|
|
}
|
|
|
|
|
|
|
|
readonly property QtObject transactionsModel: WalletTransactionsModel{}
|
2024-03-27 21:49:46 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|
2024-02-26 02:32:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SplitView {
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
Item {
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.fillHeight: true
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
anchors.fill: viewLoader
|
|
|
|
anchors.margins: -1
|
|
|
|
color: "transparent"
|
|
|
|
border.width: 1
|
|
|
|
border.color: "#808080"
|
|
|
|
}
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: viewLoader
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.margins: 50
|
|
|
|
|
|
|
|
active: false
|
|
|
|
|
|
|
|
sourceComponent: CollectibleDetailView {
|
|
|
|
collectible: d.currentCollectible
|
|
|
|
isCollectibleLoading: isLoadingCheckbox.checked
|
|
|
|
activityModel: d.transactionsModel
|
2024-03-27 21:49:46 +00:00
|
|
|
addressFilters: d.addressesSelected
|
2024-05-22 08:13:39 +00:00
|
|
|
rootStore: SharedStores.RootStore {
|
2024-09-24 12:14:21 +00:00
|
|
|
readonly property string currentCurrency: "EUR"
|
2024-02-26 02:32:59 +00:00
|
|
|
|
|
|
|
function getFiatValue(cryptoValue, symbol) {
|
|
|
|
return cryptoValue * 0.1;
|
|
|
|
}
|
|
|
|
|
|
|
|
function formatCurrencyAmount(cryptoValue, symbol) {
|
|
|
|
return "%L1 %2".arg(cryptoValue).arg(symbol)
|
|
|
|
}
|
|
|
|
}
|
2024-05-22 08:13:39 +00:00
|
|
|
walletRootStore: WalletStores.RootStore
|
2024-03-27 21:49:46 +00:00
|
|
|
|
2024-05-22 08:13:39 +00:00
|
|
|
communitiesStore: CommunitiesStores.CommunitiesStore {
|
2024-02-26 02:32:59 +00:00
|
|
|
function getCommunityDetailsAsJson(communityId) {
|
2024-04-02 08:23:20 +00:00
|
|
|
if (communityId.indexOf("unknown") >= 0) {
|
|
|
|
return { name : "", image : "", color : "" }
|
|
|
|
}
|
2024-03-11 10:08:40 +00:00
|
|
|
return {
|
|
|
|
name : "Mock Community",
|
|
|
|
image : Style.png("tokens/UNI"),
|
|
|
|
color : "orchid"
|
|
|
|
}
|
|
|
|
}
|
2024-02-26 02:32:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
Component.onCompleted: viewLoader.active = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LogsAndControlsPanel {
|
|
|
|
SplitView.minimumHeight: 100
|
|
|
|
SplitView.preferredHeight: 150
|
|
|
|
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Pane {
|
|
|
|
SplitView.minimumWidth: 300
|
|
|
|
SplitView.preferredWidth: 300
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
Label {
|
|
|
|
text: "Collectible:"
|
|
|
|
}
|
|
|
|
ComboBox {
|
|
|
|
id: collectibleComboBox
|
|
|
|
Layout.fillWidth: true
|
|
|
|
textRole: "name"
|
|
|
|
model: d.collectiblesModel
|
|
|
|
currentIndex: 0
|
|
|
|
onCurrentIndexChanged: d.refreshCurrentCollectible()
|
|
|
|
}
|
|
|
|
CheckBox {
|
|
|
|
id: isLoadingCheckbox
|
|
|
|
text: "isLoading"
|
|
|
|
checked: false
|
|
|
|
}
|
2024-03-27 21:49:46 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-02-26 02:32:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// category: Wallet
|