status-desktop/ui/app/AppLayouts/Wallet/views/CollectiblesView.qml

85 lines
2.3 KiB
QML
Raw Normal View History

2020-06-17 15:18:31 -04:00
import QtQuick 2.13
import QtQuick.Controls 2.13
2020-08-18 14:46:11 -04:00
import QtGraphicalEffects 1.13
import utils 1.0
import shared 1.0
import shared.panels 1.0
import "../stores"
import "../popups"
import "collectibles"
import StatusQ.Components 0.1
2020-05-28 10:54:42 -04:00
Item {
2020-08-18 14:46:11 -04:00
id: root
width: parent.width
signal collectibleClicked()
2020-07-28 14:19:46 -04:00
Loader {
id: contentLoader
width: parent.width
height: parent.height
sourceComponent: {
if (RootStore.collectionList.count === 0) {
return empty;
}
return loaded;
}
}
Component {
id: empty
Item {
StyledText {
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
color: Style.current.secondaryText
text: qsTr("Collectibles will appear here")
font.pixelSize: 15
}
}
}
2020-08-18 14:46:11 -04:00
Component {
id: loaded
ScrollView {
id: scrollView
clip: true
Column {
id: collectiblesSection
width: root.width
Repeater {
id: collectionsRepeater
model: RootStore.collectionList
delegate: StatusExpandableItem {
anchors.left: parent.left
anchors.right: parent.right
primaryText: model.name
image.source: model.imageUrl
type: StatusExpandableItem.Type.Secondary
expandableComponent: CollectibleCollectionView {
slug: model.slug
anchors.left: parent.left
anchors.right: parent.right
onCollectibleClicked: {
root.collectibleClicked();
}
}
2022-04-12 13:46:21 +02:00
onExpandedChanged: {
if(expanded) {
RootStore.fetchCollectionCollectiblesList(model.slug)
}
}
}
}
}
2020-08-18 14:46:11 -04:00
}
2020-07-28 14:19:46 -04:00
}
2020-05-28 10:54:42 -04:00
}