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
|
2023-08-23 11:46:04 +00:00
|
|
|
import shared.controls 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
|
2023-09-11 10:20:36 +00:00
|
|
|
import shared.panels 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
|
2023-09-21 06:58:44 +00:00
|
|
|
historyView.resetView()
|
2023-05-31 07:47:52 +00:00
|
|
|
}
|
|
|
|
|
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) {
|
2023-11-17 14:08:43 +00:00
|
|
|
case 1:
|
2022-11-28 21:05:57 +00:00
|
|
|
return qsTr("Collectibles")
|
2023-11-17 14:08:43 +00:00
|
|
|
case 2:
|
2022-09-27 08:30:18 +00:00
|
|
|
return qsTr("Assets")
|
2023-11-17 14:08:43 +00:00
|
|
|
case 3:
|
2022-09-27 08:30:18 +00:00
|
|
|
return qsTr("Activity")
|
2023-11-17 14:08:43 +00:00
|
|
|
default:
|
2022-09-27 08:30:18 +00:00
|
|
|
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-08-23 11:46:04 +00:00
|
|
|
|
|
|
|
ImportKeypairInfo {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.topMargin: Style.current.bigPadding
|
|
|
|
Layout.preferredHeight: childrenRect.height
|
|
|
|
visible: root.store.walletSectionInst.hasPairedDevices && root.store.walletSectionInst.keypairOperabilityForObservedAccount === Constants.keypair.operability.nonOperable
|
|
|
|
|
|
|
|
onRunImport: {
|
|
|
|
root.store.walletSectionInst.runKeypairImportPopup()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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-09-12 14:26:38 +00:00
|
|
|
onCurrentIndexChanged: {
|
2023-11-07 22:45:47 +00:00
|
|
|
RootStore.setCurrentViewedHoldingType(walletTabBar.currentIndex === 1 ? Constants.TokenType.ERC721 : Constants.TokenType.ERC20)
|
2023-09-12 14:26:38 +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
|
2023-11-07 22:45:47 +00:00
|
|
|
RootStore.setCurrentViewedHolding(token.symbol, Constants.TokenType.ERC20)
|
2023-04-26 17:31:34 +00:00
|
|
|
stack.currentIndex = 2
|
2022-07-28 20:56:44 +00:00
|
|
|
}
|
2023-04-26 17:31:34 +00:00
|
|
|
}
|
|
|
|
CollectiblesView {
|
2023-07-17 23:56:40 +00:00
|
|
|
collectiblesModel: RootStore.collectiblesStore.ownedCollectibles
|
2023-04-26 17:31:34 +00:00
|
|
|
onCollectibleClicked: {
|
2023-07-17 23:56:40 +00:00
|
|
|
RootStore.collectiblesStore.getDetailedCollectible(chainId, contractAddress, tokenId)
|
2023-11-07 22:45:47 +00:00
|
|
|
RootStore.setCurrentViewedHolding(uid, Constants.TokenType.ERC721)
|
2023-04-26 17:31:34 +00:00
|
|
|
stack.currentIndex = 1
|
2022-07-28 20:56:44 +00:00
|
|
|
}
|
2023-04-26 17:31:34 +00:00
|
|
|
}
|
|
|
|
HistoryView {
|
2023-09-21 06:58:44 +00:00
|
|
|
id: historyView
|
2023-04-25 16:54:50 +00:00
|
|
|
overview: RootStore.overview
|
2023-07-26 11:50:27 +00:00
|
|
|
showAllAccounts: root.showAllAccounts
|
2023-09-27 13:41:55 +00:00
|
|
|
sendModal: root.sendModal
|
2023-08-29 18:57:38 +00:00
|
|
|
onLaunchTransactionDetail: function (entry, entryIndex) {
|
|
|
|
transactionDetailView.transactionIndex = entryIndex
|
|
|
|
transactionDetailView.transaction = entry
|
|
|
|
|
2023-04-26 17:31:34 +00:00
|
|
|
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 {
|
2023-07-17 23:56:40 +00:00
|
|
|
collectible: RootStore.collectiblesStore.detailedCollectible
|
|
|
|
isCollectibleLoading: RootStore.collectiblesStore.isDetailedCollectibleLoading
|
2023-09-11 10:20:36 +00:00
|
|
|
|
|
|
|
onVisibleChanged: {
|
|
|
|
if (!visible)
|
2023-11-07 22:45:47 +00:00
|
|
|
RootStore.resetCurrentViewedHolding(Constants.TokenType.ERC721)
|
2023-09-11 10:20:36 +00:00
|
|
|
}
|
2023-04-26 17:31:34 +00:00
|
|
|
}
|
|
|
|
AssetsDetailView {
|
|
|
|
id: assetDetailView
|
2022-10-28 17:17:16 +00:00
|
|
|
|
2023-04-26 17:31:34 +00:00
|
|
|
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
|
2023-09-11 10:20:36 +00:00
|
|
|
|
|
|
|
onVisibleChanged: {
|
|
|
|
if (!visible)
|
2023-11-07 22:45:47 +00:00
|
|
|
RootStore.resetCurrentViewedHolding(Constants.TokenType.ERC20)
|
2023-09-11 10:20:36 +00:00
|
|
|
}
|
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
|
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
|
|
|
}
|
|
|
|
}
|