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

69 lines
1.8 KiB
QML

import QtQuick 2.13
import QtGraphicalEffects 1.13
import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
ModalPopup {
id: root
title: root.name || qsTr("unnamed")
property string name: "Furbeard"
property string collectibleId: "1423"
property url imageUrl: ""
property string description: "Avast ye! I'm the dread pirate Furbeard, and I'll most likely sleep"
property string permalink: "https://www.cryptokitties.co/"
property var openModal: function (options) {
root.name = options.name;
root.collectibleId = options.collectibleId;
root.description = options.description;
root.imageUrl = options.imageUrl;
root.permalink = options.permalink;
root.open();
}
Item {
width: parent.width
RoundedImage {
id: collectibleImage
width: 248
height: 248
anchors.horizontalCenter: parent.horizontalCenter
radius: 16
fillMode: Image.PreserveAspectCrop
source: root.imageUrl
}
TextWithLabel {
id: idText
anchors.top: collectibleImage.bottom
label: qsTr("id")
text: root.collectibleId
}
TextWithLabel {
id: description
anchors.top: idText.bottom
visible: !!root.description
wrap: true
label: qsTr("description")
text: root.description
}
}
footer: StatusButton {
anchors.right: parent.right
anchors.rightMargin: Style.current.padding
text: qsTr("View in Opensea")
onClicked: {
//TOOD improve this to not use dynamic scoping
appMain.openLink(root.permalink);
root.close();
}
}
}