2022-08-08 21:12:12 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
import shared.controls 1.0
|
|
|
|
|
2023-10-30 22:18:58 +00:00
|
|
|
import StatusQ 0.1
|
2022-08-08 21:12:12 +00:00
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
|
|
|
Control {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property alias primaryText: tokenName.text
|
|
|
|
property alias secondaryText: cryptoBalance.text
|
|
|
|
property alias tertiaryText: fiatBalance.text
|
|
|
|
property var balances
|
2023-10-30 22:18:58 +00:00
|
|
|
property var networksModel
|
2023-03-15 09:17:25 +00:00
|
|
|
property bool isLoading: false
|
|
|
|
property string errorTooltipText
|
2022-08-11 11:55:08 +00:00
|
|
|
property StatusAssetSettings asset: StatusAssetSettings {
|
2022-08-08 21:12:12 +00:00
|
|
|
width: 40
|
|
|
|
height: 40
|
|
|
|
}
|
2022-12-29 16:44:51 +00:00
|
|
|
property var formatBalance: function(balance){}
|
2022-08-08 21:12:12 +00:00
|
|
|
|
|
|
|
topPadding: Style.current.padding
|
|
|
|
|
|
|
|
contentItem: Column {
|
|
|
|
spacing: 4
|
|
|
|
Row {
|
|
|
|
spacing: 8
|
|
|
|
StatusSmartIdenticon {
|
|
|
|
id: identiconLoader
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2022-08-11 11:55:08 +00:00
|
|
|
asset: root.asset
|
2023-03-15 09:17:25 +00:00
|
|
|
loading: root.isLoading
|
2022-08-08 21:12:12 +00:00
|
|
|
}
|
2023-03-15 09:17:25 +00:00
|
|
|
StatusTextWithLoadingState {
|
2022-08-08 21:12:12 +00:00
|
|
|
id: tokenName
|
|
|
|
width: Math.min(root.width - identiconLoader.width - cryptoBalance.width - fiatBalance.width - 24, implicitWidth)
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
font.pixelSize: 22
|
|
|
|
lineHeight: 30
|
|
|
|
lineHeightMode: Text.FixedHeight
|
|
|
|
elide: Text.ElideRight
|
2023-03-15 09:17:25 +00:00
|
|
|
customColor: Theme.palette.directColor1
|
|
|
|
loading: root.isLoading
|
2022-08-08 21:12:12 +00:00
|
|
|
}
|
2023-03-15 09:17:25 +00:00
|
|
|
StatusTextWithLoadingState {
|
2022-08-08 21:12:12 +00:00
|
|
|
id: cryptoBalance
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
font.pixelSize: 22
|
|
|
|
lineHeight: 30
|
|
|
|
lineHeightMode: Text.FixedHeight
|
2023-03-15 09:17:25 +00:00
|
|
|
customColor: Theme.palette.baseColor1
|
|
|
|
loading: root.isLoading
|
2022-08-08 21:12:12 +00:00
|
|
|
}
|
|
|
|
StatusBaseText {
|
|
|
|
id: dotSeparator
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.verticalCenterOffset: -15
|
|
|
|
font.pixelSize: 50
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
text: "."
|
|
|
|
}
|
2023-03-15 09:17:25 +00:00
|
|
|
StatusTextWithLoadingState {
|
2022-08-08 21:12:12 +00:00
|
|
|
id: fiatBalance
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
font.pixelSize: 22
|
|
|
|
lineHeight: 30
|
|
|
|
lineHeightMode: Text.FixedHeight
|
2023-03-15 09:17:25 +00:00
|
|
|
customColor: Theme.palette.baseColor1
|
|
|
|
loading: root.isLoading
|
2022-08-08 21:12:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
Row {
|
|
|
|
spacing: Style.current.smallPadding
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: identiconLoader.width
|
|
|
|
Repeater {
|
|
|
|
id: chainRepeater
|
2023-10-30 22:18:58 +00:00
|
|
|
model: LeftJoinModel {
|
|
|
|
leftModel: root.balances
|
|
|
|
rightModel: root.networksModel
|
|
|
|
joinRole: "chainId"
|
|
|
|
}
|
2022-08-08 21:12:12 +00:00
|
|
|
delegate: InformationTag {
|
2022-12-29 16:44:51 +00:00
|
|
|
tagPrimaryLabel.text: root.formatBalance(model.balance)
|
2023-10-30 22:18:58 +00:00
|
|
|
tagPrimaryLabel.color: model.chainColor
|
|
|
|
image.source: Style.svg("tiny/%1".arg(model.iconUrl))
|
2023-03-15 09:17:25 +00:00
|
|
|
loading: root.isLoading
|
|
|
|
rightComponent: StatusFlatRoundButton {
|
|
|
|
width: 14
|
|
|
|
height: visible ? 14 : 0
|
|
|
|
icon.width: 14
|
|
|
|
icon.height: 14
|
|
|
|
icon.name: "tiny/warning"
|
|
|
|
icon.color: Theme.palette.dangerColor1
|
|
|
|
tooltip.text: root.errorTooltipText
|
|
|
|
visible: !!root.errorTooltipText
|
|
|
|
}
|
2022-08-08 21:12:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|