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
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2022-07-13 12:29:38 +00:00
|
|
|
import StatusQ.Core 0.1
|
2023-01-20 00:44:35 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
2022-07-13 12:29:38 +00:00
|
|
|
import StatusQ.Components 0.1
|
2023-03-06 16:46:32 +00:00
|
|
|
import StatusQ.Controls 0.1
|
2023-01-31 10:49:07 +00:00
|
|
|
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared.panels 1.0
|
2023-01-31 10:49:07 +00:00
|
|
|
import utils 1.0
|
2021-10-21 08:22:05 +00:00
|
|
|
|
|
|
|
import "collectibles"
|
|
|
|
|
2020-05-28 14:54:42 +00:00
|
|
|
Item {
|
2020-08-18 18:46:11 +00:00
|
|
|
id: root
|
2023-01-20 00:44:35 +00:00
|
|
|
property var collectiblesModel
|
2021-10-21 08:22:05 +00:00
|
|
|
width: parent.width
|
2023-01-20 00:44:35 +00:00
|
|
|
|
2023-03-06 16:46:32 +00:00
|
|
|
signal collectibleClicked(string address, string tokenId)
|
2023-01-20 00:44:35 +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: {
|
2023-03-06 16:46:32 +00:00
|
|
|
if (root.collectiblesModel.allCollectiblesLoaded && root.collectiblesModel.count === 0)
|
2021-10-21 08:22:05 +00:00
|
|
|
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
|
2023-01-20 00:44:35 +00:00
|
|
|
StatusGridView {
|
|
|
|
id: gridView
|
|
|
|
anchors.fill: parent
|
2023-03-06 16:46:32 +00:00
|
|
|
model: root.collectiblesModel
|
2023-01-20 00:44:35 +00:00
|
|
|
cellHeight: 229
|
|
|
|
cellWidth: 176
|
2023-01-31 10:49:07 +00:00
|
|
|
delegate: CollectibleView {
|
2023-01-20 00:44:35 +00:00
|
|
|
height: gridView.cellHeight
|
|
|
|
width: gridView.cellWidth
|
2023-03-09 16:40:34 +00:00
|
|
|
title: model.name ? model.name : "..."
|
|
|
|
subTitle: model.collectionName ? model.collectionName : ""
|
2023-04-03 15:38:05 +00:00
|
|
|
mediaUrl: model.mediaUrl ? model.mediaUrl : ""
|
|
|
|
mediaType: model.mediaType ? model.mediaType : ""
|
|
|
|
fallbackImageUrl: model.imageUrl
|
2023-03-09 16:40:34 +00:00
|
|
|
backgroundColor: model.backgroundColor ? model.backgroundColor : "transparent"
|
|
|
|
isLoading: model.isLoading
|
|
|
|
|
|
|
|
onClicked: root.collectibleClicked(model.address, model.tokenId)
|
2020-08-19 15:58:25 +00:00
|
|
|
}
|
2023-03-06 16:46:32 +00:00
|
|
|
|
|
|
|
ScrollBar.vertical: StatusScrollBar {}
|
2020-08-18 18:46:11 +00:00
|
|
|
}
|
2020-07-28 18:19:46 +00:00
|
|
|
}
|
2020-05-28 14:54:42 +00:00
|
|
|
}
|