2022-08-08 21:12:12 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
import QtQuick.Window 2.12
|
|
|
|
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
|
|
|
import utils 1.0
|
2022-09-05 14:50:20 +00:00
|
|
|
import shared.views 1.0
|
2022-08-08 21:12:12 +00:00
|
|
|
import shared.controls 1.0
|
2023-01-19 21:14:23 +00:00
|
|
|
import shared.stores 1.0
|
2022-08-08 21:12:12 +00:00
|
|
|
|
|
|
|
|
2022-10-28 17:17:16 +00:00
|
|
|
/// \beware: heavy shortcuts here, refactor to match the requirements when touching this again
|
|
|
|
/// \todo split into token history and balance views; they have different requirements that introduce unnecessary complexity
|
|
|
|
/// \todo take a declarative approach, move logic into the typed backend and remove multiple source of truth (e.g. time ranges)
|
2022-08-08 21:12:12 +00:00
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
|
2023-02-17 16:51:34 +00:00
|
|
|
property var token: ({})
|
2023-03-15 09:17:25 +00:00
|
|
|
property var networkConnectionStore
|
2022-10-28 17:17:16 +00:00
|
|
|
/*required*/ property string address: ""
|
2023-04-25 16:54:50 +00:00
|
|
|
property bool assetsLoading: true
|
2022-10-28 17:17:16 +00:00
|
|
|
|
2022-09-05 14:50:20 +00:00
|
|
|
QtObject {
|
|
|
|
id: d
|
2022-09-27 08:30:18 +00:00
|
|
|
property var marketValueStore : RootStore.marketValueStore
|
|
|
|
}
|
2022-09-05 14:50:20 +00:00
|
|
|
|
2022-09-27 08:30:18 +00:00
|
|
|
Connections {
|
|
|
|
target: walletSectionAllTokens
|
2023-01-18 09:25:36 +00:00
|
|
|
function onTokenHistoricalDataReady(tokenDetails: string) {
|
2022-09-27 08:30:18 +00:00
|
|
|
let response = JSON.parse(tokenDetails)
|
|
|
|
if (response === null) {
|
2022-10-28 17:17:16 +00:00
|
|
|
console.debug("error parsing json message for tokenHistoricalDataReady")
|
2022-09-27 08:30:18 +00:00
|
|
|
return
|
2022-09-05 14:50:20 +00:00
|
|
|
}
|
2022-09-27 08:30:18 +00:00
|
|
|
if(response.historicalData === null || response.historicalData <= 0)
|
|
|
|
return
|
2022-09-05 14:50:20 +00:00
|
|
|
|
2022-09-27 08:30:18 +00:00
|
|
|
d.marketValueStore.setTimeAndValueData(response.historicalData, response.range)
|
2022-09-05 14:50:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-08-08 21:12:12 +00:00
|
|
|
AssetsDetailsHeader {
|
|
|
|
id: tokenDetailsHeader
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
width: parent.width
|
2022-08-11 11:55:08 +00:00
|
|
|
asset.name: token && token.symbol ? Style.png("tokens/%1".arg(token.symbol)) : ""
|
|
|
|
asset.isImage: true
|
2023-03-15 09:17:25 +00:00
|
|
|
primaryText: token.name ?? Constants.dummyText
|
|
|
|
secondaryText: token ? LocaleUtils.currencyAmountToLocaleString(token.enabledNetworkBalance) : Constants.dummyText
|
|
|
|
tertiaryText: token ? LocaleUtils.currencyAmountToLocaleString(token.enabledNetworkCurrencyBalance) : Constants.dummyText
|
2022-12-29 16:44:51 +00:00
|
|
|
balances: token && token.balances ? token.balances : null
|
2023-04-25 16:54:50 +00:00
|
|
|
isLoading: root.assetsLoading
|
2023-03-22 22:08:36 +00:00
|
|
|
errorTooltipText: token && token.balances ? networkConnectionStore.getBlockchainNetworkDownTextForToken(token.balances): ""
|
2022-08-08 21:12:12 +00:00
|
|
|
getNetworkColor: function(chainId){
|
|
|
|
return RootStore.getNetworkColor(chainId)
|
|
|
|
}
|
|
|
|
getNetworkIcon: function(chainId){
|
|
|
|
return RootStore.getNetworkIcon(chainId)
|
|
|
|
}
|
2022-12-29 16:44:51 +00:00
|
|
|
formatBalance: function(balance){
|
2023-01-08 22:23:51 +00:00
|
|
|
return LocaleUtils.currencyAmountToLocaleString(balance)
|
2022-12-29 16:44:51 +00:00
|
|
|
}
|
2022-08-08 21:12:12 +00:00
|
|
|
}
|
|
|
|
|
2022-10-28 17:17:16 +00:00
|
|
|
enum GraphType {
|
|
|
|
Price = 0,
|
|
|
|
Balance
|
|
|
|
}
|
|
|
|
|
2022-09-05 14:50:20 +00:00
|
|
|
Loader {
|
|
|
|
id: graphDetailLoader
|
|
|
|
width: parent.width
|
|
|
|
height: 290
|
2022-08-08 21:12:12 +00:00
|
|
|
anchors.top: tokenDetailsHeader.bottom
|
|
|
|
anchors.topMargin: 24
|
2022-09-05 14:50:20 +00:00
|
|
|
active: root.visible
|
|
|
|
sourceComponent: StatusChartPanel {
|
|
|
|
id: graphDetail
|
2022-10-28 17:17:16 +00:00
|
|
|
|
|
|
|
property int selectedGraphType: AssetsDetailView.GraphType.Price
|
|
|
|
property var selectedStore: d.marketValueStore
|
|
|
|
|
|
|
|
function dataReady() {
|
|
|
|
return typeof selectedStore != "undefined"
|
|
|
|
}
|
|
|
|
function timeRangeSelected() {
|
|
|
|
return dataReady() && graphDetail.timeRangeTabBarIndex >= 0 && graphDetail.selectedTimeRange.length > 0
|
|
|
|
}
|
|
|
|
|
|
|
|
readonly property var labelsData: {
|
|
|
|
return timeRangeSelected()
|
|
|
|
? selectedStore.timeRange[graphDetail.timeRangeTabBarIndex][graphDetail.selectedTimeRange]
|
|
|
|
: []
|
|
|
|
}
|
|
|
|
readonly property var dataRange: {
|
|
|
|
return timeRangeSelected()
|
|
|
|
? selectedStore.dataRange[graphDetail.timeRangeTabBarIndex][graphDetail.selectedTimeRange]
|
|
|
|
: []
|
|
|
|
}
|
|
|
|
readonly property var maxTicksLimit: {
|
|
|
|
return timeRangeSelected() && typeof selectedStore.maxTicks != "undefined"
|
|
|
|
? selectedStore.maxTicks[graphDetail.timeRangeTabBarIndex][graphDetail.selectedTimeRange]
|
|
|
|
: 0
|
|
|
|
}
|
|
|
|
|
|
|
|
graphsModel: [
|
|
|
|
{text: qsTr("Price"), enabled: true, id: AssetsDetailView.GraphType.Price},
|
2022-11-15 21:48:59 +00:00
|
|
|
{text: qsTr("Balance"), enabled: true, id: AssetsDetailView.GraphType.Balance},
|
2022-10-28 17:17:16 +00:00
|
|
|
]
|
|
|
|
defaultTimeRangeIndexShown: ChartStoreBase.TimeRange.All
|
|
|
|
timeRangeModel: dataReady() && selectedStore.timeRangeTabsModel
|
|
|
|
onHeaderTabClicked: (privateIdentifier, isTimeRange) => {
|
|
|
|
if(!isTimeRange && graphDetail.selectedGraphType !== privateIdentifier) {
|
|
|
|
graphDetail.selectedGraphType = privateIdentifier
|
|
|
|
}
|
|
|
|
|
|
|
|
if(graphDetail.selectedGraphType === AssetsDetailView.GraphType.Balance) {
|
2022-11-15 21:48:59 +00:00
|
|
|
graphDetail.updateBalanceStore()
|
2022-10-28 17:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if(!isTimeRange) {
|
|
|
|
graphDetail.selectedStore = graphDetail.selectedGraphType === AssetsDetailView.GraphType.Price ? d.marketValueStore : balanceStore
|
|
|
|
}
|
|
|
|
|
|
|
|
chart.animateToNewData()
|
|
|
|
}
|
2022-09-05 14:50:20 +00:00
|
|
|
chart.chartType: 'line'
|
|
|
|
chart.chartData: {
|
|
|
|
return {
|
2023-01-10 13:04:23 +00:00
|
|
|
labels: RootStore.marketHistoryIsLoading ? [] : graphDetail.labelsData,
|
2022-09-05 14:50:20 +00:00
|
|
|
datasets: [{
|
|
|
|
xAxisId: 'x-axis-1',
|
|
|
|
yAxisId: 'y-axis-1',
|
|
|
|
backgroundColor: (Theme.palette.name === "dark") ? 'rgba(136, 176, 255, 0.2)' : 'rgba(67, 96, 223, 0.2)',
|
|
|
|
borderColor: (Theme.palette.name === "dark") ? 'rgba(136, 176, 255, 1)' : 'rgba(67, 96, 223, 1)',
|
|
|
|
borderWidth: 3,
|
|
|
|
pointRadius: 0,
|
2023-01-10 13:04:23 +00:00
|
|
|
data: RootStore.marketHistoryIsLoading ? [] : graphDetail.dataRange,
|
2022-09-27 08:30:18 +00:00
|
|
|
parsing: false,
|
2022-09-05 14:50:20 +00:00
|
|
|
}]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
chart.chartOptions: {
|
|
|
|
return {
|
|
|
|
maintainAspectRatio: false,
|
|
|
|
responsive: true,
|
|
|
|
legend: {
|
|
|
|
display: false
|
|
|
|
},
|
|
|
|
//TODO enable zoom
|
|
|
|
//zoom: {
|
|
|
|
// enabled: true,
|
|
|
|
// drag: true,
|
|
|
|
// speed: 0.1,
|
|
|
|
// threshold: 2
|
|
|
|
//},
|
|
|
|
//pan:{enabled:true,mode:'x'},
|
|
|
|
tooltips: {
|
|
|
|
intersect: false,
|
|
|
|
displayColors: false,
|
|
|
|
callbacks: {
|
|
|
|
label: function(tooltipItem, data) {
|
|
|
|
let label = data.datasets[tooltipItem.datasetIndex].label || '';
|
|
|
|
if (label) {
|
|
|
|
label += ': ';
|
|
|
|
}
|
|
|
|
label += tooltipItem.yLabel.toFixed(2);
|
2022-09-27 08:30:18 +00:00
|
|
|
return label.slice(0,label.indexOf(":")+1) + " %1".arg(RootStore.currencyStore.currentCurrencySymbol) + label.slice(label.indexOf(":") + 2, label.length);
|
2022-09-05 14:50:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
scales: {
|
|
|
|
xAxes: [{
|
|
|
|
id: 'x-axis-1',
|
|
|
|
position: 'bottom',
|
|
|
|
gridLines: {
|
|
|
|
drawOnChartArea: false,
|
|
|
|
drawBorder: false,
|
|
|
|
drawTicks: false,
|
|
|
|
},
|
|
|
|
ticks: {
|
|
|
|
fontSize: 10,
|
|
|
|
fontColor: (Theme.palette.name === "dark") ? '#909090' : '#939BA1',
|
|
|
|
padding: 16,
|
2022-09-27 08:30:18 +00:00
|
|
|
maxRotation: 0,
|
|
|
|
minRotation: 0,
|
2022-10-28 17:17:16 +00:00
|
|
|
maxTicksLimit: graphDetail.maxTicksLimit,
|
2022-09-27 08:30:18 +00:00
|
|
|
},
|
2022-09-05 14:50:20 +00:00
|
|
|
}],
|
|
|
|
yAxes: [{
|
|
|
|
position: 'left',
|
|
|
|
id: 'y-axis-1',
|
|
|
|
gridLines: {
|
|
|
|
borderDash: [8, 4],
|
|
|
|
drawBorder: false,
|
|
|
|
drawTicks: false,
|
|
|
|
color: (Theme.palette.name === "dark") ? '#909090' : '#939BA1'
|
|
|
|
},
|
|
|
|
beforeDataLimits: (axis) => {
|
|
|
|
axis.paddingTop = 25;
|
|
|
|
axis.paddingBottom = 0;
|
|
|
|
},
|
2022-10-28 17:17:16 +00:00
|
|
|
afterDataLimits: (axis) => {
|
|
|
|
if(axis.min < 0)
|
|
|
|
axis.min = 0;
|
|
|
|
},
|
2022-09-05 14:50:20 +00:00
|
|
|
ticks: {
|
|
|
|
fontSize: 10,
|
|
|
|
fontColor: (Theme.palette.name === "dark") ? '#909090' : '#939BA1',
|
|
|
|
padding: 8,
|
|
|
|
callback: function(value, index, ticks) {
|
2023-01-08 22:23:51 +00:00
|
|
|
return LocaleUtils.numberToLocaleString(value)
|
2022-09-05 14:50:20 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-10-28 17:17:16 +00:00
|
|
|
|
2023-01-10 13:04:23 +00:00
|
|
|
LoadingGraphView {
|
|
|
|
anchors.fill: chart
|
|
|
|
active: RootStore.marketHistoryIsLoading
|
|
|
|
}
|
|
|
|
|
2022-11-15 21:48:59 +00:00
|
|
|
function updateBalanceStore() {
|
|
|
|
let selectedTimeRangeEnum = balanceStore.timeRangeStrToEnum(graphDetail.selectedTimeRange)
|
|
|
|
|
|
|
|
let currencySymbol = RootStore.currencyStore.currentCurrency
|
|
|
|
if(!balanceStore.hasData(root.address, token.symbol, currencySymbol, selectedTimeRangeEnum)) {
|
|
|
|
RootStore.fetchHistoricalBalanceForTokenAsJson(root.address, token.symbol, currencySymbol, selectedTimeRangeEnum)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-28 17:17:16 +00:00
|
|
|
TokenBalanceHistoryStore {
|
|
|
|
id: balanceStore
|
|
|
|
|
2022-11-15 21:48:59 +00:00
|
|
|
onNewDataReady: (address, tokenSymbol, currencySymbol, timeRange) => {
|
|
|
|
if (timeRange === timeRangeStrToEnum(graphDetail.selectedTimeRange)) {
|
2022-10-28 17:17:16 +00:00
|
|
|
chart.updateToNewData()
|
|
|
|
}
|
|
|
|
}
|
2022-11-15 21:48:59 +00:00
|
|
|
|
|
|
|
Connections {
|
|
|
|
target: root
|
|
|
|
function onAddressChanged() { graphDetail.updateBalanceStore() }
|
|
|
|
}
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
target: token
|
|
|
|
function onSymbolChanged() { graphDetail.updateBalanceStore() }
|
|
|
|
}
|
2022-10-28 17:17:16 +00:00
|
|
|
}
|
2022-09-05 14:50:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
anchors.top: graphDetailLoader.bottom
|
|
|
|
anchors.topMargin: 24
|
|
|
|
anchors.bottom: parent.bottom
|
2022-08-08 21:12:12 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
|
|
|
|
spacing: Style.current.padding
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
InformationTile {
|
|
|
|
maxWidth: parent.width
|
|
|
|
primaryText: qsTr("Market Cap")
|
2023-03-15 09:17:25 +00:00
|
|
|
secondaryText: token && token.marketCap ? LocaleUtils.currencyAmountToLocaleString(token.marketCap) : Constants.dummyText
|
2023-04-25 16:54:50 +00:00
|
|
|
isLoading: root.assetsLoading
|
2022-08-08 21:12:12 +00:00
|
|
|
}
|
|
|
|
InformationTile {
|
|
|
|
maxWidth: parent.width
|
|
|
|
primaryText: qsTr("Day Low")
|
2023-03-15 09:17:25 +00:00
|
|
|
secondaryText: token && token.lowDay ? LocaleUtils.currencyAmountToLocaleString(token.lowDay) : Constants.dummyText
|
2023-04-25 16:54:50 +00:00
|
|
|
isLoading: root.assetsLoading
|
2022-08-08 21:12:12 +00:00
|
|
|
}
|
|
|
|
InformationTile {
|
|
|
|
maxWidth: parent.width
|
|
|
|
primaryText: qsTr("Day High")
|
2023-03-15 09:17:25 +00:00
|
|
|
secondaryText: token && token.highDay ? LocaleUtils.currencyAmountToLocaleString(token.highDay) : Constants.dummyText
|
2023-04-25 16:54:50 +00:00
|
|
|
isLoading: root.assetsLoading
|
2022-08-08 21:12:12 +00:00
|
|
|
}
|
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
InformationTile {
|
2023-02-28 14:54:10 +00:00
|
|
|
readonly property double changePctHour: token.changePctHour ?? 0
|
2022-08-08 21:12:12 +00:00
|
|
|
maxWidth: parent.width
|
|
|
|
primaryText: qsTr("Hour")
|
2023-05-02 14:05:04 +00:00
|
|
|
secondaryText: "%1%".arg(LocaleUtils.numberToLocaleString(changePctHour, 2))
|
2023-03-15 09:17:25 +00:00
|
|
|
secondaryLabel.customColor: changePctHour === 0 ? Theme.palette.directColor1 :
|
|
|
|
changePctHour < 0 ? Theme.palette.dangerColor1 :
|
|
|
|
Theme.palette.successColor1
|
2023-04-25 16:54:50 +00:00
|
|
|
isLoading: root.assetsLoading
|
2022-08-08 21:12:12 +00:00
|
|
|
}
|
|
|
|
InformationTile {
|
2023-02-28 14:54:10 +00:00
|
|
|
readonly property double changePctDay: token.changePctDay ?? 0
|
2022-08-08 21:12:12 +00:00
|
|
|
maxWidth: parent.width
|
|
|
|
primaryText: qsTr("Day")
|
2023-05-02 14:05:04 +00:00
|
|
|
secondaryText: "%1%".arg(LocaleUtils.numberToLocaleString(changePctDay, 2))
|
2023-03-15 09:17:25 +00:00
|
|
|
secondaryLabel.customColor: changePctDay === 0 ? Theme.palette.directColor1 :
|
|
|
|
changePctDay < 0 ? Theme.palette.dangerColor1 :
|
|
|
|
Theme.palette.successColor1
|
2023-04-25 16:54:50 +00:00
|
|
|
isLoading: root.assetsLoading
|
2022-08-08 21:12:12 +00:00
|
|
|
}
|
|
|
|
InformationTile {
|
2023-02-28 14:54:10 +00:00
|
|
|
readonly property double changePct24hour: token.changePct24hour ?? 0
|
2022-08-08 21:12:12 +00:00
|
|
|
maxWidth: parent.width
|
|
|
|
primaryText: qsTr("24 Hours")
|
2023-05-02 14:05:04 +00:00
|
|
|
secondaryText: "%1%".arg(LocaleUtils.numberToLocaleString(changePct24hour, 2))
|
2023-03-15 09:17:25 +00:00
|
|
|
secondaryLabel.customColor: changePct24hour === 0 ? Theme.palette.directColor1 :
|
|
|
|
changePct24hour < 0 ? Theme.palette.dangerColor1 :
|
|
|
|
Theme.palette.successColor1
|
2023-04-25 16:54:50 +00:00
|
|
|
isLoading: root.assetsLoading
|
2022-08-08 21:12:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusTabBar {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.topMargin: Style.current.xlPadding
|
|
|
|
|
|
|
|
StatusTabButton {
|
|
|
|
leftPadding: 0
|
|
|
|
width: implicitWidth
|
|
|
|
text: qsTr("Overview")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StackLayout {
|
|
|
|
id: stack
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
StatusScrollView {
|
|
|
|
id: scrollView
|
|
|
|
Layout.preferredWidth: parent.width
|
|
|
|
Layout.preferredHeight: parent.height
|
|
|
|
topPadding: 8
|
|
|
|
bottomPadding: 8
|
2023-05-31 20:58:23 +00:00
|
|
|
contentWidth: availableWidth
|
2022-08-08 21:12:12 +00:00
|
|
|
Flow {
|
|
|
|
id: detailsFlow
|
|
|
|
|
|
|
|
readonly property bool isOverflowing: detailsFlow.width - tagsLayout.width - tokenDescriptionText.width < 24
|
|
|
|
|
|
|
|
spacing: 24
|
|
|
|
|
|
|
|
width: scrollView.availableWidth
|
2023-03-15 09:17:25 +00:00
|
|
|
StatusTextWithLoadingState {
|
2022-08-08 21:12:12 +00:00
|
|
|
id: tokenDescriptionText
|
|
|
|
width: Math.max(536 , scrollView.availableWidth - tagsLayout.width - 24)
|
|
|
|
|
|
|
|
font.pixelSize: 15
|
|
|
|
lineHeight: 22
|
|
|
|
lineHeightMode: Text.FixedHeight
|
2023-03-15 09:17:25 +00:00
|
|
|
text: token.description ?? Constants.dummyText
|
|
|
|
customColor: Theme.palette.directColor1
|
2022-08-08 21:12:12 +00:00
|
|
|
elide: Text.ElideRight
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
textFormat: Qt.RichText
|
2023-04-25 16:54:50 +00:00
|
|
|
loading: root.assetsLoading
|
2022-08-08 21:12:12 +00:00
|
|
|
}
|
|
|
|
ColumnLayout {
|
|
|
|
id: tagsLayout
|
|
|
|
spacing: 10
|
|
|
|
InformationTag {
|
|
|
|
id: website
|
|
|
|
Layout.alignment: detailsFlow.isOverflowing ? Qt.AlignLeft : Qt.AlignRight
|
|
|
|
iconAsset.icon: "browser"
|
|
|
|
tagPrimaryLabel.text: qsTr("Website")
|
2022-10-28 17:17:16 +00:00
|
|
|
visible: typeof token != "undefined" && token && token.assetWebsiteUrl !== ""
|
2023-01-12 23:26:48 +00:00
|
|
|
customBackground: Component {
|
|
|
|
Rectangle {
|
|
|
|
color: Theme.palette.baseColor2
|
|
|
|
border.width: 1
|
|
|
|
border.color: "transparent"
|
|
|
|
radius: 36
|
|
|
|
}
|
|
|
|
}
|
2022-08-08 21:12:12 +00:00
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onClicked: Global.openLink(token.assetWebsiteUrl)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
InformationTag {
|
|
|
|
id: smartContractAddress
|
|
|
|
Layout.alignment: detailsFlow.isOverflowing ? Qt.AlignLeft : Qt.AlignRight
|
|
|
|
|
2023-04-04 12:09:36 +00:00
|
|
|
image.source: {
|
|
|
|
if (!token || token.builtOn === "") {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
let networkIconUrl = RootStore.getNetworkIconUrl(token.builtOn)
|
|
|
|
return networkIconUrl ? Style.svg("tiny/" + networkIconUrl) : ""
|
|
|
|
}
|
2022-08-08 21:12:12 +00:00
|
|
|
tagPrimaryLabel.text: token && token.builtOn !== "" ? RootStore.getNetworkName(token.builtOn) : "---"
|
2023-02-28 14:54:10 +00:00
|
|
|
tagSecondaryLabel.text: token.address ?? "---"
|
2022-11-03 14:11:13 +00:00
|
|
|
visible: typeof token != "undefined" && token && token.builtOn !== "" && token.address !== ""
|
2023-01-12 23:26:48 +00:00
|
|
|
customBackground: Component {
|
|
|
|
Rectangle {
|
|
|
|
color: Theme.palette.baseColor2
|
|
|
|
border.width: 1
|
|
|
|
border.color: "transparent"
|
|
|
|
radius: 36
|
|
|
|
}
|
|
|
|
}
|
2022-08-08 21:12:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|