2021-08-13 20:04:04 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.controls 1.0
|
2021-09-14 16:23:02 +00:00
|
|
|
|
|
|
|
import "stores"
|
|
|
|
import "controls"
|
2021-09-08 15:41:38 +00:00
|
|
|
import "views"
|
2021-09-14 16:23:02 +00:00
|
|
|
import "panels"
|
|
|
|
import "popups"
|
2021-09-08 15:41:38 +00:00
|
|
|
import "views/assets"
|
2021-09-14 16:23:02 +00:00
|
|
|
import "views/collectibles"
|
2021-08-13 20:04:04 +00:00
|
|
|
|
2021-09-20 03:00:50 +00:00
|
|
|
import StatusQ.Controls 0.1
|
2021-08-13 20:04:04 +00:00
|
|
|
import StatusQ.Layout 0.1
|
2021-09-20 03:00:50 +00:00
|
|
|
import StatusQ.Popups 0.1
|
2021-08-13 20:04:04 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: walletView
|
|
|
|
|
|
|
|
property bool hideSignPhraseModal: false
|
2021-09-14 16:23:02 +00:00
|
|
|
property RootStore store: RootStore { }
|
2021-08-13 20:04:04 +00:00
|
|
|
|
2021-09-14 16:23:02 +00:00
|
|
|
function showSigningPhrasePopup() {
|
|
|
|
//TODO improve this to not use dynamic scoping
|
2021-10-20 09:50:50 +00:00
|
|
|
if(!hideSignPhraseModal && !localAccountSensitiveSettings.hideSignPhraseModal){
|
2021-08-13 20:04:04 +00:00
|
|
|
signPhrasePopup.open();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SignPhraseModal {
|
|
|
|
id: signPhrasePopup
|
2021-09-14 16:23:02 +00:00
|
|
|
signingPhraseText: walletView.store.walletModelInst.utilsView.signingPhrase
|
|
|
|
onRemindLaterButtonClicked: {
|
|
|
|
hideSignPhraseModal = true;
|
|
|
|
signPhrasePopup.close();
|
|
|
|
}
|
2021-08-13 20:04:04 +00:00
|
|
|
}
|
2021-09-14 16:23:02 +00:00
|
|
|
|
|
|
|
SeedPhraseBackupWarningPanel {
|
2021-08-13 20:04:04 +00:00
|
|
|
id: seedPhraseWarning
|
|
|
|
width: parent.width
|
|
|
|
anchors.top: parent.top
|
2021-09-14 16:23:02 +00:00
|
|
|
visible: !walletView.store.profileModelInst.mnemonic.isBackedUp
|
2021-08-13 20:04:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusAppTwoPanelLayout {
|
2021-09-20 03:00:50 +00:00
|
|
|
id: layoutWalletTwoPanel
|
2021-08-13 20:04:04 +00:00
|
|
|
anchors.top: seedPhraseWarning.bottom
|
|
|
|
height: walletView.height - seedPhraseWarning.height
|
|
|
|
width: walletView.width
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
2021-10-14 08:04:15 +00:00
|
|
|
// Read in RootStore
|
|
|
|
// if (walletView.store.onboardingModelInst.firstTimeLogin) {
|
|
|
|
// walletView.store.onboardingModelInst.firstTimeLogin = false;
|
|
|
|
// walletView.store.walletModelInst.setInitialRange();
|
|
|
|
// }
|
2021-08-13 20:04:04 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 16:23:02 +00:00
|
|
|
leftPanel: LeftTabView {
|
2021-08-13 20:04:04 +00:00
|
|
|
id: leftTab
|
|
|
|
anchors.fill: parent
|
2021-09-14 16:23:02 +00:00
|
|
|
store: walletView.store
|
|
|
|
onSavedAddressesClicked: {
|
|
|
|
if (selected) {
|
|
|
|
stackView.replace(cmpSavedAddresses);
|
|
|
|
} else {
|
|
|
|
stackView.replace(walletInfoContent);
|
|
|
|
}
|
|
|
|
}
|
2021-08-13 20:04:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
rightPanel: Item {
|
2021-09-20 03:00:50 +00:00
|
|
|
property alias view: stackView
|
2021-08-13 20:04:04 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
RowLayout {
|
|
|
|
id: walletInfoContainer
|
2021-09-08 15:41:38 +00:00
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 31
|
2021-09-06 12:10:13 +00:00
|
|
|
anchors.bottom: walletFooter.top
|
2021-09-08 15:41:38 +00:00
|
|
|
anchors.bottomMargin: 24
|
2021-08-13 20:04:04 +00:00
|
|
|
anchors.left: parent.left
|
2021-09-08 15:41:38 +00:00
|
|
|
anchors.leftMargin: 80
|
2021-08-13 20:04:04 +00:00
|
|
|
anchors.right: parent.right
|
2021-09-08 15:41:38 +00:00
|
|
|
anchors.rightMargin: 80
|
|
|
|
StackBaseView {
|
|
|
|
id: stackView
|
2021-08-13 20:04:04 +00:00
|
|
|
Layout.fillWidth: true
|
2021-09-08 15:41:38 +00:00
|
|
|
Layout.fillHeight: true
|
|
|
|
initialItem: Item {
|
|
|
|
id: walletInfoContent
|
2021-09-14 16:23:02 +00:00
|
|
|
WalletHeaderPanel {
|
2021-09-08 15:41:38 +00:00
|
|
|
id: walletHeader
|
2021-09-14 16:23:02 +00:00
|
|
|
accountsModel: walletView.store.walletModelV2Inst.accountsView.accounts
|
|
|
|
currentAccount: walletView.store.walletModelV2Inst.accountsView.currentAccount
|
|
|
|
qrCode: walletView.store.profileModelInst.qrCode(walletView.store.selectedAccount.address)
|
|
|
|
allNetworksModel: walletView.store.walletModelV2Inst.networksView.allNetworks
|
|
|
|
enabledNetworksModel: walletView.store.walletModelV2Inst.networksView.enabledNetworks
|
2021-09-23 14:40:05 +00:00
|
|
|
onToggleNetwork: {
|
|
|
|
walletView.store.walletModelV2Inst.networksView.toggleNetwork(chainId)
|
|
|
|
}
|
2021-09-14 16:23:02 +00:00
|
|
|
onCopyText: {
|
|
|
|
walletView.store.copyText(text);
|
|
|
|
}
|
2021-08-17 14:22:29 +00:00
|
|
|
}
|
2021-09-08 15:41:38 +00:00
|
|
|
TabBar {
|
|
|
|
id: walletTabBar
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.top: walletHeader.bottom
|
|
|
|
anchors.topMargin: Style.current.padding
|
|
|
|
height: childrenRect.height
|
|
|
|
spacing: 24
|
2021-09-14 16:23:02 +00:00
|
|
|
background: null
|
2021-09-08 15:41:38 +00:00
|
|
|
StatusTabButton {
|
|
|
|
id: assetsBtn
|
|
|
|
btnText: qsTr("Assets")
|
|
|
|
}
|
|
|
|
StatusTabButton {
|
|
|
|
id: positionsBtn
|
|
|
|
btnText: qsTr("Positions")
|
|
|
|
}
|
|
|
|
StatusTabButton {
|
|
|
|
id: collectiblesBtn
|
|
|
|
btnText: qsTr("Collectibles")
|
|
|
|
}
|
|
|
|
StatusTabButton {
|
|
|
|
id: activityBtn
|
|
|
|
btnText: qsTr("Activity")
|
|
|
|
}
|
2021-08-17 14:22:29 +00:00
|
|
|
}
|
2021-09-08 15:41:38 +00:00
|
|
|
StackLayout {
|
|
|
|
id: stackLayout
|
|
|
|
anchors.top: walletTabBar.bottom
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.topMargin: Style.current.bigPadding
|
|
|
|
currentIndex: walletTabBar.currentIndex
|
|
|
|
|
|
|
|
AssetsView {
|
|
|
|
id: assetsTab
|
|
|
|
onAssetClicked: {
|
|
|
|
stackView.replace(assetDetailView);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
PositionsView {
|
|
|
|
id: positionsTab
|
|
|
|
}
|
|
|
|
CollectiblesView {
|
|
|
|
id: collectiblesTab
|
2021-09-14 16:23:02 +00:00
|
|
|
store: walletView.store
|
|
|
|
onCollectibleClicked: {
|
|
|
|
stackView.replace(collectibleDetailView);
|
|
|
|
}
|
2021-09-08 15:41:38 +00:00
|
|
|
}
|
|
|
|
ActivityView {
|
|
|
|
id: activityTab
|
|
|
|
}
|
2021-08-31 12:06:13 +00:00
|
|
|
}
|
2021-08-17 14:22:29 +00:00
|
|
|
}
|
2021-09-08 15:41:38 +00:00
|
|
|
}
|
2021-09-14 16:23:02 +00:00
|
|
|
}
|
2021-08-17 14:22:29 +00:00
|
|
|
|
2021-09-14 16:23:02 +00:00
|
|
|
Component {
|
|
|
|
id: assetDetailView
|
|
|
|
AssetDetailView {
|
|
|
|
onBackPressed: {
|
|
|
|
stackView.replace(walletInfoContent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-08-31 12:06:13 +00:00
|
|
|
|
2021-09-14 16:23:02 +00:00
|
|
|
Component {
|
|
|
|
id: collectibleDetailView
|
|
|
|
CollectibleDetailView {
|
|
|
|
store: walletView.store
|
|
|
|
onBackPressed: {
|
|
|
|
stackView.replace(walletInfoContent);
|
2021-08-13 20:04:04 +00:00
|
|
|
}
|
|
|
|
}
|
2021-09-14 16:23:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: cmpSavedAddresses
|
|
|
|
SavedAddressesView {
|
|
|
|
store: walletView.store
|
2021-09-20 03:00:50 +00:00
|
|
|
}
|
2021-08-13 20:04:04 +00:00
|
|
|
}
|
2021-09-06 12:10:13 +00:00
|
|
|
|
2021-09-14 16:23:02 +00:00
|
|
|
WalletFooterPanel {
|
2021-09-06 12:10:13 +00:00
|
|
|
id: walletFooter
|
|
|
|
anchors.bottom: parent.bottom
|
2021-09-14 16:23:02 +00:00
|
|
|
walletV2Model: walletView.store.walletModelV2Inst
|
2021-09-08 09:14:02 +00:00
|
|
|
}
|
2021-08-13 20:04:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|