2021-10-05 22:50:22 +02:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
|
2022-08-18 13:51:18 -04:00
|
|
|
import StatusQ.Core 0.1
|
2022-05-23 14:45:29 +03:00
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
2021-10-05 22:50:22 +02:00
|
|
|
import utils 1.0
|
2022-03-25 09:46:47 +01:00
|
|
|
import shared.views 1.0
|
2023-03-15 10:17:25 +01:00
|
|
|
import shared.stores 1.0
|
2021-10-28 00:27:49 +03:00
|
|
|
|
2022-09-05 11:15:47 +02:00
|
|
|
import "./"
|
2021-10-05 22:50:22 +02:00
|
|
|
import "../stores"
|
|
|
|
import "../panels"
|
2022-07-28 22:56:44 +02:00
|
|
|
import "../views/collectibles"
|
2021-10-05 22:50:22 +02:00
|
|
|
|
|
|
|
Item {
|
2022-07-19 15:17:35 +02:00
|
|
|
id: root
|
2021-10-05 22:50:22 +02:00
|
|
|
|
|
|
|
property alias currentTabIndex: walletTabBar.currentIndex
|
2022-01-31 14:29:27 +01:00
|
|
|
property var store
|
2022-09-05 11:15:47 +02:00
|
|
|
property var contactsStore
|
2022-03-23 12:08:49 +01:00
|
|
|
property var sendModal
|
2023-04-04 13:31:04 +02:00
|
|
|
property var networkConnectionStore
|
2023-07-26 13:50:27 +02:00
|
|
|
property bool showAllAccounts: false
|
2021-10-05 22:50:22 +02:00
|
|
|
|
2023-04-26 17:53:49 +02:00
|
|
|
signal launchShareAddressModal()
|
|
|
|
|
2023-05-31 09:47:52 +02:00
|
|
|
function resetView() {
|
|
|
|
stack.currentIndex = 0
|
|
|
|
root.currentTabIndex = 0
|
|
|
|
}
|
|
|
|
|
2022-09-13 19:17:54 +03:00
|
|
|
function resetStack() {
|
|
|
|
stack.currentIndex = 0;
|
|
|
|
}
|
|
|
|
|
2023-07-13 10:48:26 +02:00
|
|
|
Connections {
|
|
|
|
target: walletSection
|
|
|
|
|
|
|
|
function onFilterChanged() {
|
|
|
|
root.resetStack()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-27 10:30:18 +02:00
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
function getBackButtonText(index) {
|
|
|
|
switch(index) {
|
|
|
|
case 1:
|
2022-11-28 18:05:57 -03:00
|
|
|
return qsTr("Collectibles")
|
2022-09-27 10:30:18 +02:00
|
|
|
case 2:
|
|
|
|
return qsTr("Assets")
|
|
|
|
case 3:
|
|
|
|
return qsTr("Activity")
|
|
|
|
default:
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-26 19:31:34 +02:00
|
|
|
StackLayout {
|
|
|
|
id: stack
|
2022-07-28 22:56:44 +02:00
|
|
|
anchors.fill: parent
|
2023-04-26 19:31:34 +02:00
|
|
|
onCurrentIndexChanged: {
|
|
|
|
RootStore.backButtonName = d.getBackButtonText(currentIndex)
|
|
|
|
}
|
2021-10-05 22:50:22 +02:00
|
|
|
|
2023-04-26 19:31:34 +02:00
|
|
|
ColumnLayout {
|
2023-04-26 17:53:49 +02:00
|
|
|
spacing: 0
|
2023-04-26 19:31:34 +02:00
|
|
|
WalletHeader {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
overview: RootStore.overview
|
|
|
|
store: root.store
|
|
|
|
walletStore: RootStore
|
|
|
|
networkConnectionStore: root.networkConnectionStore
|
2023-04-26 17:53:49 +02:00
|
|
|
onLaunchShareAddressModal: root.launchShareAddressModal()
|
2023-05-12 09:11:44 +02:00
|
|
|
onSwitchHideWatchOnlyAccounts: RootStore.toggleWatchOnlyAccounts()
|
2022-09-13 19:17:54 +03:00
|
|
|
}
|
2023-04-26 19:31:34 +02:00
|
|
|
StatusTabBar {
|
|
|
|
id: walletTabBar
|
|
|
|
objectName: "rightSideWalletTabBar"
|
|
|
|
horizontalPadding: Style.current.padding
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.topMargin: Style.current.padding
|
2021-10-05 22:50:22 +02:00
|
|
|
|
2023-04-26 19:31:34 +02:00
|
|
|
StatusTabButton {
|
|
|
|
leftPadding: 0
|
|
|
|
width: implicitWidth
|
|
|
|
text: qsTr("Assets")
|
2022-07-28 22:56:44 +02:00
|
|
|
}
|
2023-04-26 19:31:34 +02:00
|
|
|
StatusTabButton {
|
|
|
|
width: implicitWidth
|
|
|
|
text: qsTr("Collectibles")
|
|
|
|
}
|
|
|
|
StatusTabButton {
|
|
|
|
rightPadding: 0
|
|
|
|
width: implicitWidth
|
|
|
|
text: qsTr("Activity")
|
2022-07-28 22:56:44 +02:00
|
|
|
}
|
2023-04-26 19:31:34 +02:00
|
|
|
}
|
|
|
|
StackLayout {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.topMargin: Style.current.padding
|
|
|
|
Layout.bottomMargin: Style.current.padding
|
|
|
|
currentIndex: walletTabBar.currentIndex
|
2021-10-05 22:50:22 +02:00
|
|
|
|
2023-04-26 19:31:34 +02:00
|
|
|
AssetsView {
|
2023-04-25 18:54:50 +02:00
|
|
|
assets: RootStore.assets
|
2023-04-26 19:31:34 +02:00
|
|
|
networkConnectionStore: root.networkConnectionStore
|
|
|
|
assetDetailsLaunched: stack.currentIndex === 2
|
|
|
|
onAssetClicked: {
|
|
|
|
assetDetailView.token = token
|
|
|
|
stack.currentIndex = 2
|
2022-07-28 22:56:44 +02:00
|
|
|
}
|
2023-04-26 19:31:34 +02:00
|
|
|
}
|
|
|
|
CollectiblesView {
|
2023-07-17 20:56:40 -03:00
|
|
|
collectiblesModel: RootStore.collectiblesStore.ownedCollectibles
|
2023-04-26 19:31:34 +02:00
|
|
|
onCollectibleClicked: {
|
2023-07-17 20:56:40 -03:00
|
|
|
RootStore.collectiblesStore.getDetailedCollectible(chainId, contractAddress, tokenId)
|
2023-04-26 19:31:34 +02:00
|
|
|
stack.currentIndex = 1
|
2022-07-28 22:56:44 +02:00
|
|
|
}
|
2023-04-26 19:31:34 +02:00
|
|
|
}
|
|
|
|
HistoryView {
|
2023-04-25 18:54:50 +02:00
|
|
|
overview: RootStore.overview
|
2023-07-26 13:50:27 +02:00
|
|
|
showAllAccounts: root.showAllAccounts
|
2023-04-26 19:31:34 +02:00
|
|
|
onLaunchTransactionDetail: {
|
|
|
|
transactionDetailView.transaction = transaction
|
|
|
|
stack.currentIndex = 3
|
2022-07-28 22:56:44 +02:00
|
|
|
}
|
|
|
|
}
|
2022-07-19 15:17:35 +02:00
|
|
|
}
|
2023-04-26 19:31:34 +02:00
|
|
|
}
|
|
|
|
CollectibleDetailView {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2023-07-17 20:56:40 -03:00
|
|
|
collectible: RootStore.collectiblesStore.detailedCollectible
|
|
|
|
isCollectibleLoading: RootStore.collectiblesStore.isDetailedCollectibleLoading
|
2023-04-26 19:31:34 +02:00
|
|
|
}
|
|
|
|
AssetsDetailView {
|
|
|
|
id: assetDetailView
|
2022-10-28 20:17:16 +03:00
|
|
|
|
2023-04-26 19:31:34 +02:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
visible: (stack.currentIndex === 2)
|
2022-10-28 20:17:16 +03:00
|
|
|
|
2023-04-25 18:54:50 +02:00
|
|
|
assetsLoading: RootStore.assetsLoading
|
2023-04-26 17:53:49 +02:00
|
|
|
address: RootStore.overview.mixedcaseAddress
|
2023-05-22 17:05:04 +03:00
|
|
|
|
2023-04-26 19:31:34 +02:00
|
|
|
networkConnectionStore: root.networkConnectionStore
|
2021-10-05 22:50:22 +02:00
|
|
|
}
|
2023-04-25 18:54:50 +02:00
|
|
|
|
2023-04-26 19:31:34 +02:00
|
|
|
TransactionDetailView {
|
|
|
|
id: transactionDetailView
|
2022-03-23 12:08:49 +01:00
|
|
|
Layout.fillWidth: true
|
2023-04-26 19:31:34 +02:00
|
|
|
Layout.fillHeight: true
|
2023-06-12 10:14:19 +02:00
|
|
|
onVisibleChanged: {
|
|
|
|
if (!visible)
|
|
|
|
transaction = null
|
|
|
|
}
|
2023-07-26 13:50:27 +02:00
|
|
|
showAllAccounts: root.showAllAccounts
|
2022-07-19 15:17:35 +02:00
|
|
|
sendModal: root.sendModal
|
2023-04-26 19:31:34 +02:00
|
|
|
contactsStore: root.contactsStore
|
|
|
|
visible: (stack.currentIndex === 3)
|
2022-03-23 12:08:49 +01:00
|
|
|
}
|
2021-10-05 22:50:22 +02:00
|
|
|
}
|
|
|
|
}
|