2023-02-01 17:26:59 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
import QtQuick.Layouts 1.14
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
|
|
|
import AppLayouts.Chat.helpers 1.0
|
|
|
|
import AppLayouts.Chat.controls.community 1.0
|
2023-02-13 10:40:13 +00:00
|
|
|
import AppLayouts.Chat.views.communities 1.0
|
2023-02-01 17:26:59 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
Control {
|
|
|
|
id: root
|
|
|
|
|
2023-02-13 10:40:13 +00:00
|
|
|
property var assetsModel
|
|
|
|
property var collectiblesModel
|
|
|
|
|
2023-02-01 17:26:59 +00:00
|
|
|
property var model
|
|
|
|
property string introText
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
|
|
|
|
// By design values:
|
|
|
|
readonly property int defaultHoldingsSpacing: 8
|
|
|
|
|
|
|
|
function holdingsTextFormat(name, amount) {
|
|
|
|
return CommunityPermissionsHelpers.setHoldingsTextFormat(HoldingTypes.Type.Asset, name, amount)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
contentItem: ColumnLayout {
|
|
|
|
spacing: root.spacing
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
text: root.introText
|
|
|
|
textFormat: Text.StyledText
|
|
|
|
}
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
spacing: d.defaultHoldingsSpacing
|
|
|
|
|
|
|
|
Repeater {
|
2023-02-17 13:36:58 +00:00
|
|
|
id: repeater
|
|
|
|
|
2023-02-01 17:26:59 +00:00
|
|
|
model: root.model
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
spacing: d.defaultHoldingsSpacing
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
spacing: 18 // by design
|
|
|
|
|
|
|
|
Repeater {
|
2023-02-13 10:40:13 +00:00
|
|
|
|
|
|
|
model: HoldingsSelectionModel {
|
2023-02-01 17:26:59 +00:00
|
|
|
sourceModel: holdingsListModel
|
2023-02-13 10:40:13 +00:00
|
|
|
|
|
|
|
assetsModel: root.assetsModel
|
|
|
|
collectiblesModel: root.collectiblesModel
|
2023-02-01 17:26:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusListItemTag {
|
|
|
|
enabled: false
|
|
|
|
leftPadding: 2
|
2023-02-13 10:40:13 +00:00
|
|
|
title: model.text
|
2023-02-01 17:26:59 +00:00
|
|
|
asset.name: model.imageSource
|
2023-04-25 11:31:14 +00:00
|
|
|
asset.isImage: true
|
2023-02-01 17:26:59 +00:00
|
|
|
asset.bgColor: "transparent"
|
|
|
|
asset.height: 28
|
|
|
|
asset.width: asset.height
|
2023-03-27 11:51:58 +00:00
|
|
|
asset.bgWidth: asset.height
|
|
|
|
asset.bgHeight: asset.height
|
|
|
|
asset.color: asset.isImage ? "transparent" : titleText.color
|
2023-02-01 17:26:59 +00:00
|
|
|
closeButtonVisible: false
|
|
|
|
titleText.color: model.available ? Theme.palette.primaryColor1 : Theme.palette.dangerColor1
|
|
|
|
bgColor: model.available ? Theme.palette.primaryColor2 :Theme.palette.dangerColor2
|
|
|
|
titleText.font.pixelSize: 15
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
text: qsTr("or")
|
|
|
|
textFormat: Text.StyledText
|
2023-02-17 13:36:58 +00:00
|
|
|
visible: (index !== repeater.count - 1)
|
2023-02-01 17:26:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|