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