2021-08-13 16:04:04 -04:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-14 19:23:02 +03:00
|
|
|
|
2021-09-28 18:04:06 +03:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-28 00:27:49 +03:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.status 1.0
|
2021-09-14 19:23:02 +03:00
|
|
|
import "../controls"
|
|
|
|
import "../panels"
|
|
|
|
import "../popups"
|
2021-08-13 16:04:04 -04:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: walletHeader
|
|
|
|
anchors.left: parent.left
|
2021-09-08 18:41:38 +03:00
|
|
|
anchors.right: parent.right
|
|
|
|
height: walletAddress.y + walletAddress.height
|
|
|
|
|
2021-09-14 19:23:02 +03:00
|
|
|
property var qrCode
|
|
|
|
property var accountsModel
|
|
|
|
property var currentAccount
|
|
|
|
property var enabledNetworksModel
|
|
|
|
property var allNetworksModel
|
2022-01-31 14:29:27 +01:00
|
|
|
property var store
|
2021-09-14 19:23:02 +03:00
|
|
|
signal copyText(string text)
|
2021-09-23 16:40:05 +02:00
|
|
|
signal toggleNetwork(int chainId)
|
2021-08-13 16:04:04 -04:00
|
|
|
|
2021-09-03 18:49:00 +02:00
|
|
|
Row {
|
|
|
|
id: accountRow
|
2021-09-14 19:23:02 +03:00
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 24
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: 24
|
2021-09-03 18:49:00 +02:00
|
|
|
spacing: 8
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: title
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2022-01-12 00:16:17 +01:00
|
|
|
text: walletHeader.currentAccount? walletHeader.currentAccount.name : ""
|
2021-09-03 18:49:00 +02:00
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 28
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: separatorDot
|
|
|
|
width: 8
|
|
|
|
height: 8
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.verticalCenterOffset: 1
|
|
|
|
color: Style.current.primary
|
|
|
|
radius: 50
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: walletBalance
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2022-01-12 00:16:17 +01:00
|
|
|
text: walletHeader.currentAccount? walletHeader.currentAccount.balance.toUpperCase() : ""
|
2021-09-03 18:49:00 +02:00
|
|
|
font.pixelSize: 22
|
|
|
|
}
|
2021-08-13 16:04:04 -04:00
|
|
|
}
|
|
|
|
|
2021-09-03 18:49:00 +02:00
|
|
|
MouseArea {
|
|
|
|
anchors.fill: accountRow
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onClicked: {
|
2021-12-07 22:33:12 +02:00
|
|
|
Global.openPopup(shareModalComponent);
|
2021-09-03 18:49:00 +02:00
|
|
|
}
|
2021-08-13 16:04:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusExpandableAddress {
|
|
|
|
id: walletAddress
|
2021-09-03 18:49:00 +02:00
|
|
|
anchors.top: accountRow.bottom
|
|
|
|
anchors.left: accountRow.left
|
2021-08-13 16:04:04 -04:00
|
|
|
addressWidth: 180
|
2022-01-12 00:16:17 +01:00
|
|
|
address: walletHeader.currentAccount? walletHeader.currentAccount.address : ""
|
2022-01-31 14:29:27 +01:00
|
|
|
store: walletHeader.store
|
2021-08-13 16:04:04 -04:00
|
|
|
}
|
|
|
|
|
2021-09-14 19:23:02 +03:00
|
|
|
NetworkSelectPanel {
|
2021-09-14 14:24:47 +02:00
|
|
|
id: networkSelect
|
2021-08-13 16:04:04 -04:00
|
|
|
anchors.right: parent.right
|
2021-09-14 19:23:02 +03:00
|
|
|
allNetworks: walletHeader.allNetworksModel
|
|
|
|
enabledNetworks: walletHeader.enabledNetworksModel
|
2021-09-23 16:40:05 +02:00
|
|
|
onToggleNetwork: {
|
|
|
|
walletHeader.toggleNetwork(chainId)
|
|
|
|
}
|
2021-08-13 16:04:04 -04:00
|
|
|
}
|
2021-09-03 18:49:00 +02:00
|
|
|
|
|
|
|
Component {
|
|
|
|
id: shareModalComponent
|
|
|
|
ShareModal {
|
2021-09-14 19:23:02 +03:00
|
|
|
anchors.centerIn: parent
|
|
|
|
qrCode: walletHeader.qrCode
|
|
|
|
accountsModel: walletHeader.accountsModel
|
|
|
|
selectedAccount: walletHeader.currentAccount
|
|
|
|
onCopy: {
|
|
|
|
walletHeader.copyText(text);
|
|
|
|
}
|
2021-09-03 18:49:00 +02:00
|
|
|
onClosed: {
|
2021-09-14 19:23:02 +03:00
|
|
|
this.destroy();
|
2021-09-03 18:49:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-08-13 16:04:04 -04:00
|
|
|
}
|