2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
2020-06-23 18:51:10 +00:00
|
|
|
import QtQuick.Controls 2.13
|
2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2021-06-11 13:57:43 +00:00
|
|
|
import StatusQ.Layout 0.1
|
|
|
|
|
2021-10-05 20:50:22 +00:00
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared.controls 1.0
|
2023-08-23 11:46:04 +00:00
|
|
|
import shared.popups.keypairimport 1.0
|
2021-10-14 13:39:12 +00:00
|
|
|
|
2021-10-05 20:50:22 +00:00
|
|
|
import "popups"
|
|
|
|
import "panels"
|
|
|
|
import "views"
|
|
|
|
import "stores"
|
2023-05-11 10:29:19 +00:00
|
|
|
import "controls"
|
2021-10-05 20:50:22 +00:00
|
|
|
|
2021-06-11 13:57:43 +00:00
|
|
|
Item {
|
2022-08-09 15:08:39 +00:00
|
|
|
id: root
|
2021-06-11 13:57:43 +00:00
|
|
|
|
2020-11-27 16:21:15 +00:00
|
|
|
property bool hideSignPhraseModal: false
|
2023-07-27 11:08:06 +00:00
|
|
|
property bool showAllAccounts: true
|
2022-01-31 13:29:27 +00:00
|
|
|
property var store
|
2022-03-01 10:14:13 +00:00
|
|
|
property var contactsStore
|
2022-03-10 17:01:17 +00:00
|
|
|
property var emojiPopup: null
|
2022-10-17 10:17:25 +00:00
|
|
|
property var sendModalPopup
|
2023-04-04 11:31:04 +00:00
|
|
|
property var networkConnectionStore
|
2020-11-27 16:21:15 +00:00
|
|
|
|
2023-07-06 12:59:26 +00:00
|
|
|
onVisibleChanged: resetView()
|
|
|
|
|
2023-07-27 11:08:06 +00:00
|
|
|
Connections {
|
|
|
|
target: walletSection
|
|
|
|
|
|
|
|
function onFilterChanged(address, includeWatchOnly, allAddresses) {
|
|
|
|
root.showAllAccounts = allAddresses
|
|
|
|
}
|
2023-08-23 11:46:04 +00:00
|
|
|
|
|
|
|
function onDisplayKeypairImportPopup() {
|
|
|
|
keypairImport.active = true
|
|
|
|
}
|
|
|
|
|
|
|
|
function onDestroyKeypairImportPopup() {
|
|
|
|
keypairImport.active = false
|
|
|
|
}
|
2023-07-27 11:08:06 +00:00
|
|
|
}
|
|
|
|
|
2020-11-27 16:21:15 +00:00
|
|
|
function showSigningPhrasePopup(){
|
2021-12-06 21:10:54 +00:00
|
|
|
if(!hideSignPhraseModal && !RootStore.hideSignPhraseModal){
|
2020-11-27 16:21:15 +00:00
|
|
|
signPhrasePopup.open();
|
|
|
|
}
|
|
|
|
}
|
2021-04-20 18:52:09 +00:00
|
|
|
|
2023-07-06 12:59:26 +00:00
|
|
|
function resetView() {
|
|
|
|
if (!!rightPanelStackView.currentItem.resetView)
|
|
|
|
rightPanelStackView.currentItem.resetView()
|
|
|
|
}
|
|
|
|
|
2021-06-11 13:57:43 +00:00
|
|
|
SignPhraseModal {
|
|
|
|
id: signPhrasePopup
|
2021-10-05 20:50:22 +00:00
|
|
|
onRemindLaterClicked: hideSignPhraseModal = true
|
2022-01-21 14:18:43 +00:00
|
|
|
onAcceptClicked: { RootStore.setHideSignPhraseModal(true); }
|
2021-04-20 18:52:09 +00:00
|
|
|
}
|
2020-11-27 17:32:48 +00:00
|
|
|
|
2021-09-20 12:06:14 +00:00
|
|
|
SeedPhraseBackupWarning {
|
|
|
|
id: seedPhraseWarning
|
|
|
|
width: parent.width
|
|
|
|
anchors.top: parent.top
|
|
|
|
}
|
|
|
|
|
2022-03-01 10:14:13 +00:00
|
|
|
Component {
|
|
|
|
id: cmpSavedAddresses
|
|
|
|
SavedAddressesView {
|
|
|
|
anchors.top: parent ? parent.top: undefined
|
|
|
|
anchors.left: parent ? parent.left: undefined
|
|
|
|
anchors.right: parent ? parent.right: undefined
|
2022-08-09 15:08:39 +00:00
|
|
|
contactsStore: root.contactsStore
|
2022-10-17 10:17:25 +00:00
|
|
|
sendModal: root.sendModalPopup
|
2022-03-01 10:14:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: walletContainer
|
|
|
|
RightTabView {
|
2022-08-09 15:08:39 +00:00
|
|
|
store: root.store
|
2022-09-05 09:15:47 +00:00
|
|
|
contactsStore: root.contactsStore
|
2022-10-17 10:17:25 +00:00
|
|
|
sendModal: root.sendModalPopup
|
2023-04-04 11:31:04 +00:00
|
|
|
networkConnectionStore: root.networkConnectionStore
|
2023-07-26 11:50:27 +00:00
|
|
|
showAllAccounts: leftTab.showAllAccounts
|
2023-04-26 15:53:49 +00:00
|
|
|
onLaunchShareAddressModal: Global.openPopup(receiveModalComponent);
|
2022-03-01 10:14:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
StatusSectionLayout {
|
2021-09-20 12:06:14 +00:00
|
|
|
anchors.top: seedPhraseWarning.bottom
|
2022-08-09 15:08:39 +00:00
|
|
|
height: root.height - seedPhraseWarning.height
|
|
|
|
width: root.width
|
2022-09-13 16:17:54 +00:00
|
|
|
backButtonName: RootStore.backButtonName
|
2022-10-26 16:00:20 +00:00
|
|
|
notificationCount: activityCenterStore.unreadNotificationsCount
|
2023-04-28 10:35:18 +00:00
|
|
|
hasUnseenNotifications: activityCenterStore.hasUnseenNotifications
|
2023-07-17 20:06:34 +00:00
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
onNotificationButtonClicked: Global.openActivityCenterPopup()
|
2022-09-13 16:17:54 +00:00
|
|
|
onBackButtonClicked: {
|
|
|
|
rightPanelStackView.currentItem.resetStack();
|
|
|
|
}
|
|
|
|
|
2021-10-05 20:50:22 +00:00
|
|
|
leftPanel: LeftTabView {
|
2020-11-27 17:32:48 +00:00
|
|
|
id: leftTab
|
2021-06-11 13:57:43 +00:00
|
|
|
anchors.fill: parent
|
2023-04-27 13:22:27 +00:00
|
|
|
changeSelectedAccount: function(address) {
|
2023-07-06 12:59:26 +00:00
|
|
|
root.resetView()
|
2023-08-16 14:06:56 +00:00
|
|
|
RootStore.setFilterAddress(address)
|
2023-05-12 07:11:44 +00:00
|
|
|
}
|
|
|
|
selectAllAccounts: function() {
|
2023-07-06 12:59:26 +00:00
|
|
|
root.resetView()
|
2023-08-16 14:06:56 +00:00
|
|
|
RootStore.setFillterAllAddresses()
|
2022-03-01 10:14:13 +00:00
|
|
|
}
|
2023-01-05 12:50:55 +00:00
|
|
|
onShowSavedAddressesChanged: {
|
2022-03-01 10:14:13 +00:00
|
|
|
if(showSavedAddresses)
|
|
|
|
rightPanelStackView.replace(cmpSavedAddresses)
|
|
|
|
else
|
|
|
|
rightPanelStackView.replace(walletContainer)
|
2023-04-26 17:31:34 +00:00
|
|
|
RootStore.backButtonName = ""
|
2021-10-05 20:50:22 +00:00
|
|
|
}
|
2022-08-09 15:08:39 +00:00
|
|
|
emojiPopup: root.emojiPopup
|
2023-04-04 11:31:04 +00:00
|
|
|
networkConnectionStore: root.networkConnectionStore
|
2020-11-27 17:32:48 +00:00
|
|
|
}
|
2021-06-11 13:57:43 +00:00
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
centerPanel: StackView {
|
2022-03-01 10:14:13 +00:00
|
|
|
id: rightPanelStackView
|
2021-10-05 20:50:22 +00:00
|
|
|
anchors.fill: parent
|
2022-09-13 16:17:54 +00:00
|
|
|
anchors.leftMargin: 64
|
|
|
|
anchors.rightMargin: 64
|
2022-03-01 10:14:13 +00:00
|
|
|
initialItem: walletContainer
|
|
|
|
replaceEnter: Transition {
|
|
|
|
NumberAnimation { property: "opacity"; from: 0; to: 1; duration: 400; easing.type: Easing.OutCubic }
|
|
|
|
}
|
|
|
|
replaceExit: Transition {
|
|
|
|
NumberAnimation { property: "opacity"; from: 1; to: 0; duration: 400; easing.type: Easing.OutCubic }
|
|
|
|
}
|
2020-05-27 20:50:39 +00:00
|
|
|
}
|
2023-05-11 10:29:19 +00:00
|
|
|
headerBackground: AccountHeaderGradient {
|
|
|
|
width: parent.width
|
|
|
|
overview: RootStore.overview
|
|
|
|
}
|
2023-04-26 17:31:34 +00:00
|
|
|
|
|
|
|
footer: WalletFooter {
|
2023-07-27 11:08:06 +00:00
|
|
|
visible: !root.showAllAccounts
|
2023-04-26 17:31:34 +00:00
|
|
|
width: parent.width
|
2023-07-27 11:08:06 +00:00
|
|
|
height: root.showAllAccounts ? implicitHeight : 61
|
2023-04-26 17:31:34 +00:00
|
|
|
walletStore: RootStore
|
|
|
|
networkConnectionStore: root.networkConnectionStore
|
2023-04-26 15:53:49 +00:00
|
|
|
onLaunchShareAddressModal: Global.openPopup(receiveModalComponent)
|
2023-08-31 10:27:15 +00:00
|
|
|
onLaunchSendModal: {
|
|
|
|
root.sendModalPopup.sendType = Constants.SendType.Transfer
|
|
|
|
root.sendModalPopup.preSelectedHoldingID = walletStore.currentViewedHoldingID
|
|
|
|
root.sendModalPopup.preSelectedHoldingType = walletStore.currentViewedHoldingType
|
|
|
|
root.sendModalPopup.open()
|
|
|
|
}
|
|
|
|
onLaunchBridgeModal: {
|
|
|
|
root.sendModalPopup.sendType = Constants.SendType.Bridge
|
|
|
|
root.sendModalPopup.preSelectedHoldingID = walletStore.currentViewedHoldingID
|
|
|
|
root.sendModalPopup.preSelectedHoldingType = walletStore.currentViewedHoldingType
|
|
|
|
root.sendModalPopup.open()
|
|
|
|
}
|
2023-04-26 15:53:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: receiveModalComponent
|
|
|
|
ReceiveModal {
|
|
|
|
anchors.centerIn: parent
|
2023-04-26 17:31:34 +00:00
|
|
|
}
|
2020-05-14 16:16:01 +00:00
|
|
|
}
|
2023-08-23 11:46:04 +00:00
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: keypairImport
|
|
|
|
active: false
|
|
|
|
asynchronous: true
|
|
|
|
|
|
|
|
sourceComponent: KeypairImportPopup {
|
|
|
|
store.keypairImportModule: root.store.walletSectionInst.keypairImportModule
|
|
|
|
}
|
|
|
|
|
|
|
|
onLoaded: {
|
|
|
|
keypairImport.item.open()
|
|
|
|
}
|
|
|
|
}
|
2020-05-14 16:16:01 +00:00
|
|
|
}
|