2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2022-07-19 13:17:35 +00:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
2022-08-03 12:51:47 +00:00
|
|
|
import StatusQ.Components 0.1
|
2022-07-19 13:17:35 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
2023-04-26 15:53:49 +00:00
|
|
|
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
2022-07-19 13:17:35 +00:00
|
|
|
|
2021-09-28 15:04:06 +00:00
|
|
|
import utils 1.0
|
2021-10-05 20:50:22 +00:00
|
|
|
|
|
|
|
import "../controls"
|
2021-11-11 17:25:54 +00:00
|
|
|
import "../stores"
|
2020-05-28 13:49:28 +00:00
|
|
|
|
|
|
|
Item {
|
2022-07-19 13:17:35 +00:00
|
|
|
id: root
|
2021-10-05 20:50:22 +00:00
|
|
|
|
2023-03-15 09:17:25 +00:00
|
|
|
property var networkConnectionStore
|
2023-04-13 09:59:17 +00:00
|
|
|
property var overview
|
2022-01-31 13:29:27 +00:00
|
|
|
property var store
|
2022-02-15 13:19:45 +00:00
|
|
|
property var walletStore
|
2020-06-03 19:59:18 +00:00
|
|
|
|
2023-04-26 15:53:49 +00:00
|
|
|
signal launchShareAddressModal()
|
|
|
|
signal switchHideWatchOnlyAccounts()
|
|
|
|
|
2022-09-13 16:17:54 +00:00
|
|
|
implicitHeight: 88
|
2020-05-28 13:49:28 +00:00
|
|
|
|
2022-07-19 13:17:35 +00:00
|
|
|
GridLayout {
|
|
|
|
width: parent.width
|
|
|
|
columns: 2
|
2023-04-26 15:53:49 +00:00
|
|
|
rowSpacing: 0
|
2020-05-28 13:49:28 +00:00
|
|
|
|
2022-07-19 13:17:35 +00:00
|
|
|
// account + balance
|
2022-09-13 16:17:54 +00:00
|
|
|
RowLayout {
|
2022-07-19 13:17:35 +00:00
|
|
|
spacing: Style.current.halfPadding
|
|
|
|
StatusBaseText {
|
2022-07-18 08:37:37 +00:00
|
|
|
objectName: "accountName"
|
2022-09-13 16:17:54 +00:00
|
|
|
Layout.alignment: Qt.AlignVCenter
|
2023-04-26 15:53:49 +00:00
|
|
|
verticalAlignment: Text.AlignVCenter
|
2023-05-22 15:55:47 +00:00
|
|
|
color: overview.isAllAccounts ? Theme.palette.directColor5 : Utils.getColorForId(overview.colorId)
|
2023-04-26 15:53:49 +00:00
|
|
|
lineHeightMode: Text.FixedHeight
|
|
|
|
lineHeight: 38
|
2022-07-19 13:17:35 +00:00
|
|
|
font.bold: true
|
2023-04-26 15:53:49 +00:00
|
|
|
font.pixelSize: 28
|
|
|
|
text: overview.isAllAccounts ? qsTr("All Accounts") : overview.name
|
2022-07-19 13:17:35 +00:00
|
|
|
}
|
2023-04-26 15:53:49 +00:00
|
|
|
StatusEmoji {
|
2022-09-13 16:17:54 +00:00
|
|
|
Layout.alignment: Qt.AlignVCenter
|
2023-04-26 15:53:49 +00:00
|
|
|
Layout.preferredWidth: 28
|
|
|
|
Layout.preferredHeight: 28
|
|
|
|
emojiId: StatusQUtils.Emoji.iconId(overview.emoji ?? "", StatusQUtils.Emoji.size.big) || ""
|
|
|
|
visible: !overview.isAllAccounts
|
2022-07-19 13:17:35 +00:00
|
|
|
}
|
|
|
|
}
|
2020-05-28 13:49:28 +00:00
|
|
|
|
2023-04-26 15:53:49 +00:00
|
|
|
RowLayout {
|
|
|
|
spacing: 16
|
2022-07-19 13:17:35 +00:00
|
|
|
Layout.alignment: Qt.AlignTrailing
|
2023-04-26 15:53:49 +00:00
|
|
|
Layout.topMargin: 5
|
2023-04-05 11:10:44 +00:00
|
|
|
|
2023-04-26 15:53:49 +00:00
|
|
|
StatusButton {
|
|
|
|
Layout.preferredHeight: 38
|
|
|
|
Layout.alignment: Qt.AlignTop
|
2023-03-08 13:44:47 +00:00
|
|
|
|
2023-04-26 15:53:49 +00:00
|
|
|
spacing: 8
|
|
|
|
size: StatusBaseButton.Size.Small
|
|
|
|
borderColor: Theme.palette.directColor7
|
|
|
|
normalColor: Theme.palette.transparent
|
|
|
|
hoverColor: Theme.palette.baseColor2
|
|
|
|
|
|
|
|
font.weight: Font.Normal
|
|
|
|
textPosition: StatusBaseButton.TextPosition.Left
|
|
|
|
textColor: Theme.palette.baseColor1
|
|
|
|
text: overview.ens || StatusQUtils.Utils.elideText(overview.mixedcaseAddress, 6, 4)
|
|
|
|
|
|
|
|
icon.name: "invite-users"
|
|
|
|
icon.height: 16
|
|
|
|
icon.width: 16
|
|
|
|
icon.color: hovered ? Theme.palette.directColor1 : Theme.palette.baseColor1
|
|
|
|
|
|
|
|
onClicked: launchShareAddressModal()
|
|
|
|
visible: !overview.isAllAccounts
|
2023-04-05 11:10:44 +00:00
|
|
|
}
|
2020-05-28 13:49:28 +00:00
|
|
|
|
2022-08-03 12:51:47 +00:00
|
|
|
|
2023-04-26 15:53:49 +00:00
|
|
|
StatusButton {
|
2023-06-08 13:27:02 +00:00
|
|
|
objectName: "hideShowWatchOnlyButton"
|
2023-04-26 15:53:49 +00:00
|
|
|
Layout.preferredHeight: 38
|
|
|
|
Layout.alignment: Qt.AlignTop
|
|
|
|
|
|
|
|
spacing: 8
|
|
|
|
size: StatusBaseButton.Size.Small
|
|
|
|
borderColor: Theme.palette.directColor7
|
|
|
|
normalColor: Theme.palette.transparent
|
|
|
|
hoverColor: Theme.palette.baseColor2
|
|
|
|
|
|
|
|
font.weight: Font.Normal
|
|
|
|
textColor: Theme.palette.baseColor1
|
2023-06-26 15:57:16 +00:00
|
|
|
text: overview.includeWatchOnly ? qsTr("Hide watch-only"): qsTr("Show watch-only")
|
2023-04-26 15:53:49 +00:00
|
|
|
|
2023-06-26 15:57:16 +00:00
|
|
|
icon.name: overview.includeWatchOnly ? "hide" : "show"
|
2023-04-26 15:53:49 +00:00
|
|
|
icon.height: 16
|
|
|
|
icon.width: 16
|
|
|
|
icon.color: Theme.palette.baseColor1
|
|
|
|
|
|
|
|
onClicked: switchHideWatchOnlyAccounts()
|
|
|
|
visible: overview.isAllAccounts
|
|
|
|
}
|
|
|
|
|
|
|
|
// network filter
|
|
|
|
NetworkFilter {
|
|
|
|
id: networkFilter
|
|
|
|
|
|
|
|
Layout.alignment: Qt.AlignTop
|
|
|
|
|
|
|
|
allNetworks: walletStore.allNetworks
|
|
|
|
layer1Networks: walletStore.layer1Networks
|
|
|
|
layer2Networks: walletStore.layer2Networks
|
|
|
|
enabledNetworks: walletStore.enabledNetworks
|
|
|
|
|
|
|
|
onToggleNetwork: (network) => {
|
|
|
|
walletStore.toggleNetwork(network.chainId)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
spacing: 4
|
|
|
|
visible: !networkConnectionStore.accountBalanceNotAvailable
|
|
|
|
StatusTextWithLoadingState {
|
|
|
|
font.pixelSize: 28
|
|
|
|
font.bold: true
|
|
|
|
customColor: Theme.palette.directColor1
|
2023-07-05 09:34:55 +00:00
|
|
|
text: loading ? Constants.dummyText : LocaleUtils.currencyAmountToLocaleString(root.overview.currencyBalance)
|
2023-04-26 15:53:49 +00:00
|
|
|
loading: root.overview.balanceLoading
|
|
|
|
lineHeightMode: Text.FixedHeight
|
|
|
|
lineHeight: 38
|
|
|
|
}
|
2022-07-19 13:17:35 +00:00
|
|
|
}
|
2022-02-15 13:19:45 +00:00
|
|
|
}
|
2022-07-19 13:17:35 +00:00
|
|
|
}
|