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
|
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
|
2021-10-05 22:50:22 +02:00
|
|
|
|
2022-09-13 19:17:54 +03:00
|
|
|
function resetStack() {
|
|
|
|
stack.currentIndex = 0;
|
|
|
|
}
|
|
|
|
|
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 ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-23 12:08:49 +01:00
|
|
|
ColumnLayout {
|
2022-07-28 22:56:44 +02:00
|
|
|
anchors.fill: parent
|
2021-10-05 22:50:22 +02:00
|
|
|
|
2022-07-28 22:56:44 +02:00
|
|
|
StackLayout {
|
|
|
|
id: stack
|
2021-10-05 22:50:22 +02:00
|
|
|
Layout.fillWidth: true
|
2022-07-28 22:56:44 +02:00
|
|
|
Layout.preferredHeight: parent.height - footer.height
|
2022-09-13 19:17:54 +03:00
|
|
|
onCurrentIndexChanged: {
|
2022-09-27 10:30:18 +02:00
|
|
|
RootStore.backButtonName = d.getBackButtonText(currentIndex)
|
2022-09-13 19:17:54 +03:00
|
|
|
}
|
2021-10-05 22:50:22 +02:00
|
|
|
|
2022-07-28 22:56:44 +02:00
|
|
|
ColumnLayout {
|
|
|
|
WalletHeader {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
currency: RootStore.currentCurrency
|
|
|
|
currentAccount: RootStore.currentAccount
|
|
|
|
store: root.store
|
|
|
|
walletStore: RootStore
|
|
|
|
}
|
|
|
|
StatusTabBar {
|
|
|
|
id: walletTabBar
|
2022-08-10 16:26:29 +02:00
|
|
|
objectName: "rightSideWalletTabBar"
|
2022-07-28 22:56:44 +02:00
|
|
|
horizontalPadding: Style.current.padding
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.topMargin: Style.current.padding
|
2021-10-05 22:50:22 +02:00
|
|
|
|
2022-07-28 22:56:44 +02:00
|
|
|
StatusTabButton {
|
|
|
|
leftPadding: 0
|
|
|
|
width: implicitWidth
|
|
|
|
text: qsTr("Assets")
|
|
|
|
}
|
|
|
|
StatusTabButton {
|
|
|
|
width: implicitWidth
|
|
|
|
text: qsTr("Collectibles")
|
|
|
|
}
|
|
|
|
StatusTabButton {
|
|
|
|
rightPadding: 0
|
|
|
|
width: implicitWidth
|
|
|
|
text: qsTr("Activity")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
StackLayout {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2022-09-13 19:17:54 +03:00
|
|
|
Layout.topMargin: Style.current.padding
|
|
|
|
Layout.bottomMargin: Style.current.padding
|
2022-07-28 22:56:44 +02:00
|
|
|
currentIndex: walletTabBar.currentIndex
|
2021-10-05 22:50:22 +02:00
|
|
|
|
2022-07-28 22:56:44 +02:00
|
|
|
AssetsView {
|
|
|
|
account: RootStore.currentAccount
|
2022-08-08 23:12:12 +02:00
|
|
|
assetDetailsLaunched: stack.currentIndex === 2
|
|
|
|
onAssetClicked: {
|
|
|
|
assetDetailView.token = token
|
|
|
|
stack.currentIndex = 2
|
|
|
|
}
|
2022-07-28 22:56:44 +02:00
|
|
|
}
|
|
|
|
CollectiblesView {
|
2023-01-19 21:44:35 -03:00
|
|
|
collectiblesModel: RootStore.flatCollectibles
|
2022-07-28 22:56:44 +02:00
|
|
|
onCollectibleClicked: {
|
2023-03-06 13:46:32 -03:00
|
|
|
RootStore.selectCollectible(address, tokenId)
|
2022-07-28 22:56:44 +02:00
|
|
|
stack.currentIndex = 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
HistoryView {
|
|
|
|
account: RootStore.currentAccount
|
2022-09-05 11:15:47 +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
|
|
|
}
|
2022-07-28 22:56:44 +02:00
|
|
|
CollectibleDetailView {
|
2022-08-08 23:12:12 +02:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
}
|
|
|
|
AssetsDetailView {
|
|
|
|
id: assetDetailView
|
2022-10-28 20:17:16 +03:00
|
|
|
|
2022-08-08 23:12:12 +02:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2022-09-19 17:50:25 +03:00
|
|
|
visible: (stack.currentIndex === 2)
|
2022-10-28 20:17:16 +03:00
|
|
|
|
|
|
|
address: RootStore.currentAccount.mixedcaseAddress
|
2021-10-05 22:50:22 +02:00
|
|
|
}
|
2022-09-05 11:15:47 +02:00
|
|
|
TransactionDetailView {
|
|
|
|
id: transactionDetailView
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
sendModal: root.sendModal
|
|
|
|
contactsStore: root.contactsStore
|
2022-09-27 10:30:18 +02:00
|
|
|
visible: (stack.currentIndex === 3)
|
2022-09-05 11:15:47 +02:00
|
|
|
}
|
2021-10-05 22:50:22 +02:00
|
|
|
}
|
2022-03-23 12:08:49 +01:00
|
|
|
|
|
|
|
WalletFooter {
|
2022-07-28 22:56:44 +02:00
|
|
|
id: footer
|
2022-03-23 12:08:49 +01:00
|
|
|
Layout.fillWidth: true
|
2022-12-20 17:23:49 +02:00
|
|
|
Layout.leftMargin: !!root.StackView ? -root.StackView.view.anchors.leftMargin : 0
|
|
|
|
Layout.rightMargin: !!root.StackView ? -root.StackView.view.anchors.rightMargin : 0
|
2022-07-19 15:17:35 +02:00
|
|
|
sendModal: root.sendModal
|
2022-07-20 14:15:05 +03:00
|
|
|
walletStore: RootStore
|
2022-03-23 12:08:49 +01:00
|
|
|
}
|
2021-10-05 22:50:22 +02:00
|
|
|
}
|
|
|
|
}
|