2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
2021-10-21 08:22:05 +00:00
|
|
|
import QtQuick.Controls 2.13
|
2020-08-18 18:46:11 +00:00
|
|
|
import QtGraphicalEffects 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
2021-10-21 08:22:05 +00:00
|
|
|
|
2021-10-05 20:50:22 +00:00
|
|
|
import "../stores"
|
2021-10-21 08:22:05 +00:00
|
|
|
import "../popups"
|
|
|
|
import "collectibles"
|
|
|
|
|
|
|
|
import StatusQ.Components 0.1
|
2020-05-28 14:54:42 +00:00
|
|
|
|
|
|
|
Item {
|
2020-08-18 18:46:11 +00:00
|
|
|
id: root
|
2021-10-21 08:22:05 +00:00
|
|
|
width: parent.width
|
|
|
|
signal collectibleClicked()
|
2020-07-28 18:19:46 +00:00
|
|
|
|
2021-10-21 08:22:05 +00:00
|
|
|
Loader {
|
|
|
|
id: contentLoader
|
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
2020-07-30 20:46:25 +00:00
|
|
|
|
2021-10-21 08:22:05 +00:00
|
|
|
sourceComponent: {
|
|
|
|
if (RootStore.collectionList.count === 0) {
|
|
|
|
return empty;
|
|
|
|
}
|
|
|
|
return loaded;
|
|
|
|
}
|
2020-08-19 15:58:25 +00:00
|
|
|
}
|
|
|
|
|
2021-10-21 08:22:05 +00:00
|
|
|
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-20 21:59:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-08-18 18:46:11 +00:00
|
|
|
|
2021-10-21 08:22:05 +00:00
|
|
|
Component {
|
|
|
|
id: loaded
|
2020-08-19 17:07:07 +00:00
|
|
|
|
2021-10-21 08:22:05 +00:00
|
|
|
ScrollView {
|
|
|
|
id: scrollView
|
|
|
|
clip: true
|
2020-08-19 17:07:07 +00:00
|
|
|
|
2021-10-21 08:22:05 +00:00
|
|
|
Column {
|
|
|
|
id: collectiblesSection
|
|
|
|
width: root.width
|
2020-08-19 17:07:07 +00:00
|
|
|
|
2021-10-21 08:22:05 +00:00
|
|
|
Repeater {
|
|
|
|
id: collectionsRepeater
|
|
|
|
model: RootStore.collectionList
|
|
|
|
delegate: StatusExpandableItem {
|
2021-11-02 12:57:52 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2021-10-21 08:22:05 +00:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-10-05 20:50:22 +00:00
|
|
|
}
|
2020-08-19 15:58:25 +00:00
|
|
|
}
|
2020-08-18 18:46:11 +00:00
|
|
|
}
|
2020-07-28 18:19:46 +00:00
|
|
|
}
|
2020-05-28 14:54:42 +00:00
|
|
|
}
|