2022-11-23 17:58:22 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Core 0.1
|
2023-01-10 13:04:23 +00:00
|
|
|
import StatusQ.Controls 0.1
|
2022-11-23 17:58:22 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
StatusListItem {
|
2022-12-29 16:44:51 +00:00
|
|
|
id: root
|
2023-01-10 13:04:23 +00:00
|
|
|
|
|
|
|
property alias localeCurrencyBalance: localeCurrencyBalance
|
|
|
|
property alias change24Hour: change24HourText
|
|
|
|
property alias change24HourPercentage: change24HourPercentageText
|
|
|
|
|
|
|
|
property string currentCurrencySymbol
|
|
|
|
property string textColor: changePct24hour === undefined ? Theme.palette.baseColor1 :
|
|
|
|
Math.sign(changePct24hour) === 0 ? Theme.palette.baseColor1 :
|
|
|
|
Math.sign(changePct24hour) === -1 ? Theme.palette.dangerColor1 :
|
|
|
|
Theme.palette.successColor1
|
|
|
|
|
2022-11-23 17:58:22 +00:00
|
|
|
title: name
|
2023-01-08 22:23:51 +00:00
|
|
|
subTitle: LocaleUtils.currencyAmountToLocaleString(enabledNetworkBalance)
|
2022-11-23 17:58:22 +00:00
|
|
|
asset.name: symbol ? Style.png("tokens/" + symbol) : ""
|
|
|
|
asset.isImage: true
|
2023-01-10 13:04:23 +00:00
|
|
|
|
2022-11-23 17:58:22 +00:00
|
|
|
components: [
|
|
|
|
Column {
|
|
|
|
id: valueColumn
|
2023-01-10 13:04:23 +00:00
|
|
|
StatusTextWithLoadingState {
|
|
|
|
id: localeCurrencyBalance
|
2022-11-23 17:58:22 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
font.pixelSize: 15
|
|
|
|
font.strikeout: false
|
2023-01-08 22:23:51 +00:00
|
|
|
text: LocaleUtils.currencyAmountToLocaleString(enabledNetworkCurrencyBalance)
|
2022-11-23 17:58:22 +00:00
|
|
|
}
|
|
|
|
Row {
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
spacing: 8
|
2023-01-10 13:04:23 +00:00
|
|
|
StatusTextWithLoadingState {
|
2022-11-23 17:58:22 +00:00
|
|
|
id: change24HourText
|
|
|
|
font.pixelSize: 15
|
|
|
|
font.strikeout: false
|
2023-01-10 13:04:23 +00:00
|
|
|
customColor: root.textColor
|
2023-01-08 22:23:51 +00:00
|
|
|
text: LocaleUtils.currencyAmountToLocaleString(currencyPrice)
|
2022-11-23 17:58:22 +00:00
|
|
|
}
|
|
|
|
Rectangle {
|
|
|
|
width: 1
|
|
|
|
height: change24HourText.implicitHeight
|
|
|
|
color: Theme.palette.directColor9
|
|
|
|
}
|
2023-01-10 13:04:23 +00:00
|
|
|
StatusTextWithLoadingState {
|
|
|
|
id: change24HourPercentageText
|
2022-11-23 17:58:22 +00:00
|
|
|
font.pixelSize: 15
|
|
|
|
font.strikeout: false
|
2023-01-10 13:04:23 +00:00
|
|
|
customColor: root.textColor
|
2022-12-29 16:44:51 +00:00
|
|
|
text: changePct24hour !== "" ? changePct24hour.toFixed(2) + "%" : "---"
|
2022-11-23 17:58:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|