2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
2020-08-18 18:46:11 +00:00
|
|
|
import QtGraphicalEffects 1.13
|
2020-06-18 15:31:52 +00:00
|
|
|
import "../../../imports"
|
2020-06-19 18:06:58 +00:00
|
|
|
import "../../../shared"
|
2020-08-18 19:10:30 +00:00
|
|
|
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
|
|
|
|
2020-07-30 20:46:25 +00:00
|
|
|
Loader {
|
2020-08-18 18:46:11 +00:00
|
|
|
active: true
|
2020-08-19 21:09:11 +00:00
|
|
|
sourceComponent: root.isLoading || walletModel.collectibles.rowCount() > 0 ? collectiblesListComponent
|
2020-08-18 18:46:11 +00:00
|
|
|
: noCollectiblesComponent
|
|
|
|
width: parent.width
|
2020-07-30 20:46:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-19 15:58:25 +00:00
|
|
|
|
|
|
|
CollectiblesModal {
|
|
|
|
id: collectiblesModalComponent
|
|
|
|
}
|
|
|
|
|
2020-08-18 18:46:11 +00:00
|
|
|
Component {
|
|
|
|
id: collectiblesListComponent
|
|
|
|
|
2020-08-19 17:07:07 +00:00
|
|
|
Column {
|
|
|
|
spacing: Style.current.halfPadding
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
CollectiblesContainer {
|
|
|
|
collectibleName: "CryptoKitties"
|
2020-08-19 21:09:11 +00:00
|
|
|
collectibleType: Constants.cryptokitty
|
2020-08-19 17:07:07 +00:00
|
|
|
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"
|
2020-08-19 21:09:11 +00:00
|
|
|
collectibleType: Constants.ethermon
|
2020-08-19 17:07:07 +00:00
|
|
|
collectibleIconSource: "../../img/collectibles/ethermons.png"
|
|
|
|
isLoading: root.isLoading
|
|
|
|
collectiblesModal: collectiblesModalComponent
|
|
|
|
buttonText: qsTr("View in Ethermon")
|
|
|
|
getLink: function (id) {
|
2020-08-20 14:16:58 +00:00
|
|
|
// TODO find a more direct URL
|
|
|
|
return "https://ethermon.io/inventory"
|
2020-08-19 17:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
CollectiblesContainer {
|
|
|
|
collectibleName: "Kudos"
|
2020-08-19 21:09:11 +00:00
|
|
|
collectibleType: Constants.kudo
|
2020-08-19 17:07:07 +00:00
|
|
|
collectibleIconSource: "../../img/collectibles/kudos.png"
|
|
|
|
isLoading: root.isLoading
|
|
|
|
collectiblesModal: collectiblesModalComponent
|
|
|
|
buttonText: qsTr("View in Gitcoin")
|
2020-08-20 14:16:58 +00:00
|
|
|
getLink: function (id, externalUrl) {
|
|
|
|
return externalUrl
|
2020-08-19 17:07:07 +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
|
|
|
}
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
target: walletModel
|
|
|
|
onLoadingCollectibles: {
|
2020-08-18 18:46:11 +00:00
|
|
|
root.isLoading= isLoading
|
2020-07-28 18:19:46 +00:00
|
|
|
}
|
2020-06-18 15:31:52 +00:00
|
|
|
}
|
2020-05-28 14:54:42 +00:00
|
|
|
}
|
2020-06-17 19:18:31 +00:00
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
2020-06-18 15:31:52 +00:00
|
|
|
D{i:0;autoSize:true;formeditorColor:"#ffffff";height:480;width:640}
|
2020-06-17 19:18:31 +00:00
|
|
|
}
|
|
|
|
##^##*/
|