status-desktop/ui/app/AppLayouts/Wallet/CollectiblesTab.qml

95 lines
2.9 KiB
QML
Raw Normal View History

2020-06-17 19:18:31 +00:00
import QtQuick 2.13
2020-08-18 18:46:11 +00:00
import QtGraphicalEffects 1.13
import "../../../imports"
import "../../../shared"
import "./components/collectiblesComponents"
2020-05-28 14:54:42 +00:00
Item {
2020-08-18 18:46:11 +00:00
property bool isLoading: true
id: root
2020-07-28 18:19:46 +00:00
Loader {
2020-08-18 18:46:11 +00:00
active: true
sourceComponent: root.isLoading || walletModel.collectibles.rowCount() > 0 ? collectiblesListComponent
2020-08-18 18:46:11 +00:00
: noCollectiblesComponent
width: parent.width
}
Component {
2020-08-18 18:46:11 +00:00
id: noCollectiblesComponent
StyledText {
color: Style.current.secondaryText
text: qsTr("Collectibles will appear here")
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: 15
visible: !root.isLoading && walletModel.collectibles.rowCount() === 0
}
}
CollectiblesModal {
id: collectiblesModalComponent
}
2020-08-18 18:46:11 +00:00
Component {
id: collectiblesListComponent
Column {
spacing: Style.current.halfPadding
anchors.fill: parent
CollectiblesContainer {
collectibleName: "CryptoKitties"
collectibleType: Constants.cryptokitty
collectibleIconSource: "../../img/collectibles/CryptoKitties.png"
isLoading: root.isLoading
collectiblesModal: collectiblesModalComponent
buttonText: qsTr("View in Cryptokitties")
getLink: function (id) {
return `https://www.cryptokitties.co/kitty/${id}`
}
}
CollectiblesContainer {
collectibleName: "Ethermons"
collectibleType: Constants.ethermon
collectibleIconSource: "../../img/collectibles/ethermons.png"
isLoading: root.isLoading
collectiblesModal: collectiblesModalComponent
buttonText: qsTr("View in Ethermon")
getLink: function (id) {
// TODO find a more direct URL
return "https://ethermon.io/inventory"
}
}
CollectiblesContainer {
collectibleName: "Kudos"
collectibleType: Constants.kudo
collectibleIconSource: "../../img/collectibles/kudos.png"
isLoading: root.isLoading
collectiblesModal: collectiblesModalComponent
buttonText: qsTr("View in Gitcoin")
getLink: function (id, externalUrl) {
return externalUrl
}
}
2020-08-18 18:46:11 +00:00
}
2020-07-28 18:19:46 +00:00
}
Connections {
target: walletModel
onLoadingCollectibles: {
2020-08-18 18:46:11 +00:00
root.isLoading= isLoading
2020-07-28 18:19:46 +00:00
}
}
2020-05-28 14:54:42 +00:00
}
2020-06-17 19:18:31 +00:00
/*##^##
Designer {
D{i:0;autoSize:true;formeditorColor:"#ffffff";height:480;width:640}
2020-06-17 19:18:31 +00:00
}
##^##*/