Skip to content

Commit

Permalink
feat(ProfileShowcase): Enable add more accounts component
Browse files Browse the repository at this point in the history
- Added new additional footer component in `EmptyShapeRectangleFooterListView`.
- Enabled more accounts component in profile showcase assets and collectibles panel.

Closes #13590
  • Loading branch information
noeliaSD committed Feb 22, 2024
1 parent 4031778 commit f31f01d
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 38 deletions.
20 changes: 9 additions & 11 deletions ui/app/AppLayouts/Profile/panels/ProfileShowcaseAssetsPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,15 @@ ProfileShowcasePanel {
root.showcaseEntryChanged()
}
}
additionalFooterComponent: root.addAccountsButtonVisible ? addMoreAccountsComponent : null

// TODO: Issue #13590
// additionalComponent: root.addAccountsButtonVisible ? addMoreAccountsComponent : null
Component {
id: addMoreAccountsComponent

// Component {
// id: addMoreAccountsComponent

// AddMoreAccountsLink {
// visible: root.addAccountsButtonVisible
// text: qsTr("Don’t see some of your assets?")
// onClicked: root.navigateToAccountsTab()
// }
// }
AddMoreAccountsLink {
visible: root.addAccountsButtonVisible
text: qsTr("Don’t see some of your assets?")
onClicked: root.navigateToAccountsTab()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,15 @@ ProfileShowcasePanel {
root.showcaseEntryChanged()
}
}
additionalFooterComponent: root.addAccountsButtonVisible ? addMoreAccountsComponent : null

// TODO: Issue #13590
// additionalComponent: root.addAccountsButtonVisible ? addMoreAccountsComponent : null
Component {
id: addMoreAccountsComponent

// Component {
// id: addMoreAccountsComponent

// AddMoreAccountsLink {
// visible: root.addAccountsButtonVisible
// text: qsTr("Don’t see some of your collectibles?")
// onClicked: root.navigateToAccountsTab()
// }
// }
AddMoreAccountsLink {
visible: root.addAccountsButtonVisible
text: qsTr("Don’t see some of your collectibles?")
onClicked: root.navigateToAccountsTab()
}
}
}
3 changes: 3 additions & 0 deletions ui/app/AppLayouts/Profile/panels/ProfileShowcasePanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ DoubleFlickableWithFolding {
property Component showcaseDraggableDelegateComponent
property Component hiddenDraggableDelegateComponent

property Component additionalFooterComponent

property string emptyInShowcasePlaceholderText
property string emptyHiddenPlaceholderText

Expand Down Expand Up @@ -179,6 +181,7 @@ DoubleFlickableWithFolding {
placeholderText: root.emptyHiddenPlaceholderText
placeholderHeight: d.shapeRectangleHeight
empty: root.showcaseModel.hiddenCount === 0 && !root.flickable2Folded // TO BE REMOVE: #13498
additionalFooterComponent: root.additionalFooterComponent

header: FoldableHeader {
width: ListView.view.width
Expand Down
35 changes: 19 additions & 16 deletions ui/imports/shared/controls/EmptyShapeRectangleFooterListView.qml
Original file line number Diff line number Diff line change
@@ -1,40 +1,43 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQml 2.15

import StatusQ.Core 0.1

import utils 1.0

StatusListView {
id: root

property string placeholderText
property int placeholderHeight: 44
property Component additionalFooterComponent

// TO BE REMOVE: #13498
property bool empty: root.model && root.count === 0

ScrollBar.vertical: null

Binding {
when: root.empty// TO BE REPLACE by (#13498): root.model && root.count === 0
target: root
property: "footer"
restoreMode: Binding.RestoreBindingOrValue
footer: ColumnLayout {
width: root.width

ShapeRectangle {
id: shapeRectangle

value: Component {
Item {
height: root.placeholderHeight
width: root.width
Layout.preferredHeight: root.placeholderHeight
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.margins: 1

ShapeRectangle {
id: shapeRectangle
visible: root.empty// TO BE REPLACE by (#13498): root.model && root.count === 0
text: root.placeholderText
}

text: root.placeholderText
Loader {
Layout.preferredWidth: root.width

anchors.fill: parent
anchors.margins: 1
}
}
sourceComponent: root.additionalFooterComponent
}
}

Expand Down

0 comments on commit f31f01d

Please sign in to comment.