2022-02-11 09:44:49 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
import QtGraphicalEffects 1.13
|
|
|
|
|
2022-03-15 13:38:20 +00:00
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
2022-02-11 09:44:49 +00:00
|
|
|
import utils 1.0
|
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.popups 1.0
|
|
|
|
import shared.status 1.0
|
|
|
|
|
|
|
|
import "../stores"
|
|
|
|
import "../controls"
|
|
|
|
import "../popups"
|
|
|
|
import "../panels"
|
|
|
|
import "./wallet"
|
|
|
|
|
2022-03-15 13:38:20 +00:00
|
|
|
Item {
|
2022-02-11 09:44:49 +00:00
|
|
|
id: root
|
|
|
|
|
2022-03-10 17:01:17 +00:00
|
|
|
property var emojiPopup
|
2022-02-11 09:44:49 +00:00
|
|
|
property WalletStore walletStore
|
|
|
|
|
2022-03-15 13:38:20 +00:00
|
|
|
anchors.fill: parent
|
2022-03-02 12:54:58 +00:00
|
|
|
|
2022-03-15 13:38:20 +00:00
|
|
|
readonly property int mainViewIndex: 0;
|
|
|
|
readonly property int networksViewIndex: 1;
|
|
|
|
readonly property int accountViewIndex: 2;
|
|
|
|
readonly property int dappPermissionViewIndex: 3;
|
2022-02-11 09:44:49 +00:00
|
|
|
|
2022-03-15 13:38:20 +00:00
|
|
|
StatusBanner {
|
|
|
|
id: banner
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.right: parent.right
|
|
|
|
visible: walletStore.areTestNetworksEnabled
|
|
|
|
type: StatusBanner.Type.Danger
|
|
|
|
statusText: qsTr("Testnet mode is enabled. All balances, transactions and dApp interactions will be on testnets.")
|
|
|
|
}
|
2022-02-11 09:44:49 +00:00
|
|
|
|
2022-03-15 13:38:20 +00:00
|
|
|
ScrollView {
|
2022-03-02 12:54:58 +00:00
|
|
|
|
2022-03-15 13:38:20 +00:00
|
|
|
anchors.top: banner.visible ? banner.bottom: parent.top
|
2022-04-13 10:10:51 +00:00
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
clip: true
|
2022-03-07 09:33:38 +00:00
|
|
|
|
2022-03-15 13:38:20 +00:00
|
|
|
StackLayout {
|
|
|
|
id: stackContainer
|
|
|
|
|
|
|
|
anchors.fill: parent
|
|
|
|
currentIndex: mainViewIndex
|
|
|
|
|
|
|
|
MainView {
|
|
|
|
id: main
|
|
|
|
Layout.preferredWidth: 560
|
|
|
|
leftPadding: 64
|
|
|
|
topPadding: 64
|
|
|
|
walletStore: root.walletStore
|
2022-03-04 09:09:58 +00:00
|
|
|
|
2022-03-15 13:38:20 +00:00
|
|
|
onGoToNetworksView: {
|
|
|
|
stackContainer.currentIndex = networksViewIndex
|
|
|
|
}
|
|
|
|
|
|
|
|
onGoToAccountView: {
|
|
|
|
root.walletStore.switchAccountByAddress(address)
|
|
|
|
stackContainer.currentIndex = accountViewIndex
|
|
|
|
}
|
|
|
|
|
|
|
|
onGoToDappPermissionsView: {
|
|
|
|
stackContainer.currentIndex = dappPermissionViewIndex
|
|
|
|
}
|
2022-02-11 09:44:49 +00:00
|
|
|
}
|
|
|
|
|
2022-03-15 13:38:20 +00:00
|
|
|
NetworksView {
|
|
|
|
walletStore: root.walletStore
|
|
|
|
onGoBack: {
|
|
|
|
stackContainer.currentIndex = mainViewIndex
|
|
|
|
}
|
2022-02-11 09:44:49 +00:00
|
|
|
}
|
2022-03-07 09:33:38 +00:00
|
|
|
|
2022-03-15 13:38:20 +00:00
|
|
|
AccountView {
|
|
|
|
walletStore: root.walletStore
|
|
|
|
emojiPopup: root.emojiPopup
|
|
|
|
onGoBack: {
|
|
|
|
stackContainer.currentIndex = mainViewIndex
|
|
|
|
}
|
2022-03-04 09:09:58 +00:00
|
|
|
}
|
|
|
|
|
2022-03-15 13:38:20 +00:00
|
|
|
DappPermissionsView {
|
|
|
|
walletStore: root.walletStore
|
|
|
|
onGoBack: {
|
|
|
|
stackContainer.currentIndex = mainViewIndex
|
|
|
|
}
|
2022-03-07 09:33:38 +00:00
|
|
|
}
|
2022-02-11 09:44:49 +00:00
|
|
|
}
|
|
|
|
}
|
2022-04-13 10:10:51 +00:00
|
|
|
}
|