status-desktop/ui/app/AppLayouts/WalletV2/views/CollectiblesView.qml
Alexandra Betouni 4ee21ada05 feat(desktop) Added image function in Style
Introduced Style.svg() Style.png() Style.emoji() and
Style.icon() in Style.qml. Those should be used to
set the source in Images instead of using relative
paths. Usage:
Image {
   source: Style.svg("check)
   ....

Also moved all Singletons inside a new "utils"
folder and made it a QML module, to use
import utils 1.0 instead of relative paths

Closes #3678
2021-09-28 15:28:00 -04:00

100 lines
2.8 KiB
QML

import QtQuick 2.13
import QtQuick.Controls 2.13
import QtGraphicalEffects 1.13
import utils 1.0
import "../../../../shared"
import "../../../../shared/status/core"
import "../popups"
import "collectibles"
import StatusQ.Components 0.1
Item {
id: root
width: parent.width
property var store
signal collectibleClicked()
Loader {
id: contentLoader
width: parent.width
height: parent.height
sourceComponent: {
if (root.store.walletModelV2Inst.collectiblesView.isLoading) {
return loading;
}
if (root.store.walletModelV2Inst.collectiblesView.collections.rowCount() === 0) {
return empty;
}
return loaded;
}
}
Component {
id: loading
Item {
StatusLoadingIndicator {
width: 20
height: 20
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
}
}
}
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
}
}
}
Component {
id: loaded
ScrollView {
id: scrollView
clip: true
Column {
id: collectiblesSection
width: parent.width
Repeater {
id: collectionsRepeater
model: root.store.walletModelV2Inst.collectiblesView.collections
//model: 5
delegate: StatusExpandableItem {
width: parent.width - 156
anchors.horizontalCenter: parent.horizontalCenter
primaryText: model.name
image.source: model.imageUrl
type: StatusExpandableItem.Type.Secondary
expandableComponent: CollectibleCollectionView {
store: root.store
slug: model.slug
anchors.left: parent.left
anchors.leftMargin: Style.current.bigPadding
anchors.right: parent.right
anchors.rightMargin: Style.current.bigPadding
onCollectibleClicked: {
root.collectibleClicked();
}
}
}
}
}
}
}
}