2022-11-28 21:05:57 +00:00
|
|
|
import QtQuick 2.14
|
2021-10-21 08:22:05 +00:00
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
2023-03-06 16:46:32 +00:00
|
|
|
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
2021-10-21 08:22:05 +00:00
|
|
|
|
2023-09-20 13:01:37 +00:00
|
|
|
import AppLayouts.Communities.panels 1.0
|
|
|
|
|
2022-07-28 20:56:44 +00:00
|
|
|
import utils 1.0
|
|
|
|
import shared.controls 1.0
|
|
|
|
|
2021-12-06 21:10:54 +00:00
|
|
|
import "../../stores"
|
2021-10-21 08:22:05 +00:00
|
|
|
import "../../controls"
|
|
|
|
|
2022-07-28 20:56:44 +00:00
|
|
|
Item {
|
2021-10-21 08:22:05 +00:00
|
|
|
id: root
|
|
|
|
|
2023-07-17 23:56:40 +00:00
|
|
|
property var collectible
|
|
|
|
property bool isCollectibleLoading
|
2022-11-28 21:05:57 +00:00
|
|
|
readonly property int isNarrowMode : width < 700
|
2022-11-22 19:31:07 +00:00
|
|
|
|
2023-09-20 13:01:37 +00:00
|
|
|
// Community related token props:
|
|
|
|
readonly property bool isOwnerTokenType: !!collectible ? (collectible.communityPrivilegesLevel === Constants.TokenPrivilegesLevel.Owner) : false
|
|
|
|
readonly property bool isTMasterTokenType: !!collectible ? (collectible.communityPrivilegesLevel === Constants.TokenPrivilegesLevel.TMaster) : false
|
|
|
|
|
2021-10-21 08:22:05 +00:00
|
|
|
CollectibleDetailsHeader {
|
|
|
|
id: collectibleHeader
|
2022-07-28 20:56:44 +00:00
|
|
|
anchors.top: parent.top
|
2021-10-21 08:22:05 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2023-07-17 23:56:40 +00:00
|
|
|
asset.name: collectible.collectionImageUrl
|
2022-08-11 11:55:08 +00:00
|
|
|
asset.isImage: true
|
2023-07-17 23:56:40 +00:00
|
|
|
primaryText: collectible.collectionName
|
|
|
|
secondaryText: "#" + collectible.tokenId
|
2022-11-28 21:05:57 +00:00
|
|
|
isNarrowMode: root.isNarrowMode
|
2023-07-17 23:56:40 +00:00
|
|
|
networkShortName: collectible.networkShortName
|
|
|
|
networkColor: collectible.networkColor
|
|
|
|
networkIconURL: collectible.networkIconUrl
|
2021-10-21 08:22:05 +00:00
|
|
|
}
|
|
|
|
|
2022-07-28 20:56:44 +00:00
|
|
|
ColumnLayout {
|
2022-11-28 21:05:57 +00:00
|
|
|
id: collectibleBody
|
2021-10-21 08:22:05 +00:00
|
|
|
anchors.top: collectibleHeader.bottom
|
2022-11-28 21:05:57 +00:00
|
|
|
anchors.topMargin: 25
|
2022-07-28 20:56:44 +00:00
|
|
|
anchors.left: parent.left
|
2022-11-28 21:05:57 +00:00
|
|
|
anchors.leftMargin: root.isNarrowMode ? 0 : 52
|
2022-07-28 20:56:44 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
|
|
|
spacing: Style.current.padding
|
2021-10-21 08:22:05 +00:00
|
|
|
|
|
|
|
Row {
|
|
|
|
id: collectibleImageDetails
|
2023-09-20 13:01:37 +00:00
|
|
|
|
|
|
|
readonly property real visibleImageHeight: (collectibleimage.visible ? collectibleimage.height : privilegedCollectibleImage.height)
|
|
|
|
readonly property real visibleImageWidth: (collectibleimage.visible ? collectibleimage.width : privilegedCollectibleImage.width)
|
|
|
|
|
|
|
|
Layout.preferredHeight: collectibleImageDetails.visibleImageHeight
|
2022-07-28 20:56:44 +00:00
|
|
|
Layout.preferredWidth: parent.width
|
2021-10-21 08:22:05 +00:00
|
|
|
spacing: 24
|
|
|
|
|
2023-09-20 13:01:37 +00:00
|
|
|
// Special artwork representation for community `Owner and Master Token` token types:
|
|
|
|
PrivilegedTokenArtworkPanel {
|
|
|
|
id: privilegedCollectibleImage
|
|
|
|
|
|
|
|
visible: root.isOwnerTokenType || root.isTMasterTokenType
|
|
|
|
size: root.isNarrowMode ? PrivilegedTokenArtworkPanel.Size.Medium : PrivilegedTokenArtworkPanel.Size.Large
|
|
|
|
artwork: collectible.imageUrl
|
|
|
|
color: !!collectible ? collectible.communityColor : "transparent"
|
|
|
|
isOwner: root.isOwnerTokenType
|
|
|
|
}
|
|
|
|
|
2023-04-03 15:38:05 +00:00
|
|
|
StatusRoundedMedia {
|
2021-10-21 08:22:05 +00:00
|
|
|
id: collectibleimage
|
2023-09-20 13:01:37 +00:00
|
|
|
|
2022-11-28 21:05:57 +00:00
|
|
|
readonly property int size : root.isNarrowMode ? 132 : 253
|
2023-09-20 13:01:37 +00:00
|
|
|
|
|
|
|
visible: !privilegedCollectibleImage.visible
|
2022-11-28 21:05:57 +00:00
|
|
|
width: size
|
|
|
|
height: size
|
2021-10-21 08:22:05 +00:00
|
|
|
radius: 2
|
2023-07-17 23:56:40 +00:00
|
|
|
color: collectible.backgroundColor
|
2021-10-21 08:22:05 +00:00
|
|
|
border.color: Theme.palette.directColor8
|
|
|
|
border.width: 1
|
2023-07-17 23:56:40 +00:00
|
|
|
mediaUrl: collectible.mediaUrl
|
|
|
|
mediaType: collectible.mediaType
|
|
|
|
fallbackImageUrl: collectible.imageUrl
|
2021-10-21 08:22:05 +00:00
|
|
|
}
|
2022-11-28 21:05:57 +00:00
|
|
|
|
|
|
|
Column {
|
|
|
|
id: collectibleNameAndDescription
|
|
|
|
spacing: 12
|
|
|
|
|
2023-09-20 13:01:37 +00:00
|
|
|
width: parent.width - collectibleImageDetails.visibleImageWidth - Style.current.bigPadding
|
2022-11-28 21:05:57 +00:00
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
id: collectibleName
|
|
|
|
width: parent.width
|
|
|
|
height: 24
|
|
|
|
|
2023-07-17 23:56:40 +00:00
|
|
|
text: collectible.name
|
2022-11-28 21:05:57 +00:00
|
|
|
color: Theme.palette.directColor1
|
|
|
|
font.pixelSize: 17
|
|
|
|
lineHeight: 24
|
|
|
|
elide: Text.ElideRight
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusScrollView {
|
|
|
|
id: descriptionScrollView
|
|
|
|
width: parent.width
|
|
|
|
height: collectibleImageDetails.height - collectibleName.height - parent.spacing
|
|
|
|
|
|
|
|
contentWidth: availableWidth
|
|
|
|
|
|
|
|
padding: 0
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
id: descriptionText
|
|
|
|
width: descriptionScrollView.availableWidth
|
|
|
|
|
2023-07-17 23:56:40 +00:00
|
|
|
text: collectible.description
|
2022-11-28 21:05:57 +00:00
|
|
|
textFormat: Text.MarkdownText
|
|
|
|
color: Theme.palette.directColor4
|
|
|
|
font.pixelSize: 15
|
|
|
|
lineHeight: 22
|
|
|
|
lineHeightMode: Text.FixedHeight
|
|
|
|
elide: Text.ElideRight
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
}
|
|
|
|
}
|
2021-10-21 08:22:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-28 20:56:44 +00:00
|
|
|
StatusTabBar {
|
|
|
|
id: collectiblesDetailsTab
|
|
|
|
Layout.fillWidth: true
|
2023-09-20 13:01:37 +00:00
|
|
|
Layout.topMargin: root.isNarrowMode ? Style.current.padding : Style.current.xlPadding
|
2023-07-17 23:56:40 +00:00
|
|
|
visible: collectible.traits.count > 0
|
2021-10-21 08:22:05 +00:00
|
|
|
|
2022-07-28 20:56:44 +00:00
|
|
|
StatusTabButton {
|
|
|
|
leftPadding: 0
|
|
|
|
width: implicitWidth
|
|
|
|
text: qsTr("Properties")
|
2021-10-21 08:22:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-28 21:05:57 +00:00
|
|
|
StatusScrollView {
|
|
|
|
id: scrollView
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2023-05-31 20:58:23 +00:00
|
|
|
contentWidth: availableWidth
|
2022-07-28 20:56:44 +00:00
|
|
|
Flow {
|
2022-11-28 21:05:57 +00:00
|
|
|
width: scrollView.availableWidth
|
2022-07-28 20:56:44 +00:00
|
|
|
spacing: 10
|
|
|
|
Repeater {
|
2023-07-17 23:56:40 +00:00
|
|
|
model: collectible.traits
|
2022-07-28 20:56:44 +00:00
|
|
|
InformationTile {
|
|
|
|
maxWidth: parent.width
|
|
|
|
primaryText: model.traitType
|
|
|
|
secondaryText: model.value
|
2021-10-21 08:22:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|