2023-03-20 12:29:05 +00:00
|
|
|
|
import QtQuick 2.15
|
2024-02-09 11:05:51 +00:00
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
|
2024-02-28 12:19:14 +00:00
|
|
|
|
import StatusQ 0.1
|
2024-02-09 11:05:51 +00:00
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
|
import StatusQ.Controls 0.1
|
2023-03-20 12:29:05 +00:00
|
|
|
|
|
|
|
|
|
import utils 1.0
|
2024-02-09 11:05:51 +00:00
|
|
|
|
import shared.panels 1.0
|
2023-03-20 12:29:05 +00:00
|
|
|
|
|
|
|
|
|
import AppLayouts.Profile.controls 1.0
|
|
|
|
|
|
|
|
|
|
ProfileShowcasePanel {
|
|
|
|
|
id: root
|
|
|
|
|
|
2024-02-09 11:05:51 +00:00
|
|
|
|
required property bool addAccountsButtonVisible
|
|
|
|
|
|
2024-01-13 03:24:57 +00:00
|
|
|
|
property var formatCurrencyAmount: function(amount, symbol){}
|
|
|
|
|
|
2024-02-09 11:05:51 +00:00
|
|
|
|
signal navigateToAccountsTab()
|
|
|
|
|
|
2024-02-15 17:26:05 +00:00
|
|
|
|
emptyInShowcasePlaceholderText: qsTr("Assets here will show on your profile")
|
|
|
|
|
emptyHiddenPlaceholderText: qsTr("Assets here will be hidden from your profile")
|
2024-03-03 16:34:08 +00:00
|
|
|
|
emptySearchPlaceholderText: qsTr("No assets matching search")
|
|
|
|
|
searchPlaceholderText: qsTr("Search asset name, symbol or community")
|
2024-02-29 09:07:35 +00:00
|
|
|
|
delegate: ProfileShowcasePanelDelegate {
|
2024-02-28 12:19:14 +00:00
|
|
|
|
|
2024-03-04 22:07:09 +00:00
|
|
|
|
readonly property double totalValue: !!model && !!model.decimals ? balancesAggregator.value/(10 ** model.decimals): 0
|
2024-02-28 12:19:14 +00:00
|
|
|
|
|
|
|
|
|
title: !!model && !!model.name ? model.name : ""
|
|
|
|
|
secondaryTitle: !!model && !!model.enabledNetworkBalance ?
|
|
|
|
|
LocaleUtils.currencyAmountToLocaleString(model.enabledNetworkBalance) :
|
|
|
|
|
!!model && !!model.symbol ? root.formatCurrencyAmount(totalValue, model.symbol) : Qt.locale().zeroDigit
|
|
|
|
|
|
|
|
|
|
hasImage: true
|
|
|
|
|
icon.source: !!model ? Constants.tokenIcon(model.symbol) : ""
|
|
|
|
|
|
|
|
|
|
SumAggregator {
|
|
|
|
|
id: balancesAggregator
|
|
|
|
|
model: !!model && !!model.balances ? model.balances: null
|
|
|
|
|
roleName: "balance"
|
2023-03-20 12:29:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-02-28 12:19:14 +00:00
|
|
|
|
|
2024-02-21 13:39:27 +00:00
|
|
|
|
additionalFooterComponent: root.addAccountsButtonVisible ? addMoreAccountsComponent : null
|
2024-02-09 11:05:51 +00:00
|
|
|
|
|
2024-02-21 13:39:27 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: addMoreAccountsComponent
|
2024-02-09 11:05:51 +00:00
|
|
|
|
|
2024-02-21 13:39:27 +00:00
|
|
|
|
AddMoreAccountsLink {
|
|
|
|
|
visible: root.addAccountsButtonVisible
|
|
|
|
|
text: qsTr("Don’t see some of your assets?")
|
|
|
|
|
onClicked: root.navigateToAccountsTab()
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-03-20 12:29:05 +00:00
|
|
|
|
}
|