Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ProfileShowcase): Enable add more accounts component #13664

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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