2020-08-19 15:58:25 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtGraphicalEffects 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-20 10:21:23 +00:00
|
|
|
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
2021-10-14 11:33:34 +00:00
|
|
|
import "../../../../shared/popups"
|
2021-10-05 20:50:22 +00:00
|
|
|
import "../panels"
|
2020-08-19 15:58:25 +00:00
|
|
|
|
2021-10-14 11:33:34 +00:00
|
|
|
// TODO: Replace with StatusModal
|
2020-08-19 15:58:25 +00:00
|
|
|
ModalPopup {
|
|
|
|
property string collectibleName: "Furbeard"
|
|
|
|
property string collectibleId: "1423"
|
2021-09-28 15:04:06 +00:00
|
|
|
property url collectibleImage: Style.png("collectibles/placeholders/kitty")
|
2020-08-19 15:58:25 +00:00
|
|
|
property string collectibleDescription: "Avast ye! I'm the dread pirate Furbeard, and I'll most likely sleep"
|
|
|
|
property string buttonText: "View in Cryptokitties"
|
|
|
|
property string buttonLink: "https://www.cryptokitties.co/"
|
|
|
|
property var openModal: function (options) {
|
|
|
|
popup.collectibleName = options.name
|
|
|
|
popup.collectibleId = options.id
|
|
|
|
popup.collectibleDescription = options.description
|
|
|
|
popup.collectibleImage = options.image
|
2020-08-26 15:52:26 +00:00
|
|
|
//% "View"
|
|
|
|
popup.buttonText = options.buttonText || qsTrId("view")
|
2020-08-19 15:58:25 +00:00
|
|
|
popup.buttonLink = options.link
|
|
|
|
popup.open()
|
|
|
|
}
|
|
|
|
|
|
|
|
id: popup
|
2020-08-26 15:52:26 +00:00
|
|
|
//% "Unnamed"
|
|
|
|
title: collectibleName || qsTrId("unnamed")
|
2020-08-19 15:58:25 +00:00
|
|
|
|
|
|
|
CollectiblesModalContent {
|
|
|
|
collectibleName: popup.collectibleName
|
|
|
|
collectibleId: popup.collectibleId
|
|
|
|
collectibleImage: popup.collectibleImage
|
|
|
|
collectibleDescription: popup.collectibleDescription
|
|
|
|
}
|
|
|
|
|
2021-01-28 11:04:10 +00:00
|
|
|
footer: StatusButton {
|
2020-08-19 15:58:25 +00:00
|
|
|
visible: !!popup.buttonLink
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Style.current.padding
|
2021-01-28 11:04:10 +00:00
|
|
|
text: popup.buttonText
|
2020-08-19 15:58:25 +00:00
|
|
|
anchors.top: parent.top
|
|
|
|
onClicked: {
|
2020-12-29 20:33:54 +00:00
|
|
|
appMain.openLink(popup.buttonLink)
|
2021-08-16 12:14:42 +00:00
|
|
|
popup.close()
|
2020-08-19 15:58:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|