mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-15 00:55:22 +00:00
07484cb15c
1. Fix `EmptyShapeRectangleFooterListView` visibility and positioning after ListView items are animated out of view 2. Update `ShowcaseDelegate` to remove modelObject dependency. The UI properties needed will be received from parent 3. Update `ProfileShowcasePanel` to remove the previous logic involving rows move and visibility change. There is no need now for two specialised delegate components (one for in showcase and one for hidden). The delegate is still configured outside of this component because the model rolenames need to be mapped to the delegate properties. The common delegate logic is implemented in the `ProfileShowcasePanel` and only the model mapping is needed from parent component. 3. Update all `ProfileShowcase*Panel` to impement the new API 4. Remove all `*ShowcaseDelegate`. The delegate is simple enough to be configured at once in the Panel
56 lines
1.7 KiB
QML
56 lines
1.7 KiB
QML
import QtQuick 2.15
|
||
import QtQuick.Layouts 1.15
|
||
|
||
import StatusQ 0.1
|
||
import StatusQ.Core 0.1
|
||
import StatusQ.Controls 0.1
|
||
|
||
import utils 1.0
|
||
import shared.panels 1.0
|
||
|
||
import AppLayouts.Profile.controls 1.0
|
||
|
||
ProfileShowcasePanel {
|
||
id: root
|
||
|
||
required property bool addAccountsButtonVisible
|
||
|
||
property var formatCurrencyAmount: function(amount, symbol){}
|
||
|
||
signal navigateToAccountsTab()
|
||
|
||
emptyInShowcasePlaceholderText: qsTr("Assets here will show on your profile")
|
||
emptyHiddenPlaceholderText: qsTr("Assets here will be hidden from your profile")
|
||
|
||
delegate: ProfileShowcasePanel.Delegate {
|
||
|
||
property double totalValue: !!model && !!model.decimals ? balancesAggregator.value/(10 ** model.decimals): 0
|
||
|
||
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"
|
||
}
|
||
}
|
||
|
||
additionalFooterComponent: root.addAccountsButtonVisible ? addMoreAccountsComponent : null
|
||
|
||
Component {
|
||
id: addMoreAccountsComponent
|
||
|
||
AddMoreAccountsLink {
|
||
visible: root.addAccountsButtonVisible
|
||
text: qsTr("Don’t see some of your assets?")
|
||
onClicked: root.navigateToAccountsTab()
|
||
}
|
||
}
|
||
}
|