2023-05-04 10:29:01 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
2023-03-15 17:14:31 +00:00
|
|
|
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
2023-05-04 10:29:01 +00:00
|
|
|
import AppLayouts.Chat.panels.communities 1.0
|
|
|
|
import AppLayouts.Chat.controls.community 1.0
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
2023-03-15 17:14:31 +00:00
|
|
|
import Storybook 1.0
|
|
|
|
import Models 1.0
|
|
|
|
|
|
|
|
|
|
|
|
SplitView {
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
|
2023-05-04 10:29:01 +00:00
|
|
|
property bool globalUtilsReady: false
|
|
|
|
property bool mainModuleReady: false
|
|
|
|
|
2023-03-15 17:14:31 +00:00
|
|
|
Logs { id: logs }
|
|
|
|
|
2023-05-04 10:29:01 +00:00
|
|
|
QtObject {
|
|
|
|
function isCompressedPubKey(publicKey) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
function getCompressedPk(publicKey) {
|
|
|
|
return "compressed_" + publicKey
|
|
|
|
}
|
|
|
|
|
|
|
|
function getColorId(publicKey) {
|
|
|
|
return Math.floor(Math.random() * 10)
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
Utils.globalUtilsInst = this
|
|
|
|
globalUtilsReady = true
|
|
|
|
|
|
|
|
}
|
|
|
|
Component.onDestruction: {
|
|
|
|
globalUtilsReady = false
|
|
|
|
Utils.globalUtilsInst = {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
function getContactDetailsAsJson() {
|
|
|
|
return JSON.stringify({ ensVerified: true })
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
mainModuleReady = true
|
|
|
|
Utils.mainModuleInst = this
|
|
|
|
}
|
|
|
|
Component.onDestruction: {
|
|
|
|
mainModuleReady = false
|
|
|
|
Utils.mainModuleInst = {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-15 17:14:31 +00:00
|
|
|
Rectangle {
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.fillHeight: true
|
|
|
|
color: Theme.palette.statusAppLayout.rightPanelBackgroundColor
|
|
|
|
|
2023-05-04 10:29:01 +00:00
|
|
|
Loader {
|
2023-03-15 17:14:31 +00:00
|
|
|
anchors.fill: parent
|
2023-05-04 10:29:01 +00:00
|
|
|
active: globalUtilsReady && mainModuleReady
|
|
|
|
|
|
|
|
sourceComponent: CommunityAirdropsSettingsPanel {
|
|
|
|
id: communityAirdropsSettingsPanel
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.topMargin: 50
|
|
|
|
assetsModel: AssetsModel {}
|
|
|
|
collectiblesModel: ListModel {}
|
|
|
|
|
|
|
|
CollectiblesModel {
|
|
|
|
id: collectiblesModel
|
|
|
|
}
|
|
|
|
|
|
|
|
SortFilterProxyModel {
|
|
|
|
id: collectiblesModelWithSupply
|
|
|
|
|
|
|
|
sourceModel: collectiblesModel
|
|
|
|
|
|
|
|
proxyRoles: [
|
|
|
|
ExpressionRole {
|
|
|
|
name: "supply"
|
|
|
|
expression: ((model.index + 1) * 115).toString()
|
|
|
|
},
|
|
|
|
ExpressionRole {
|
|
|
|
name: "infiniteSupply"
|
|
|
|
expression: !(model.index % 4)
|
|
|
|
},
|
|
|
|
ExpressionRole {
|
|
|
|
name: "chainName"
|
|
|
|
expression: model.index ? "Optimism" : "Arbitrum"
|
|
|
|
},
|
|
|
|
ExpressionRole {
|
|
|
|
|
|
|
|
readonly property string icon1: "network/Network=Optimism"
|
|
|
|
readonly property string icon2: "network/Network=Arbitrum"
|
|
|
|
|
|
|
|
name: "chainIcon"
|
|
|
|
expression: model.index ? icon1 : icon2
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
filters: ValueFilter {
|
|
|
|
roleName: "category"
|
|
|
|
value: TokenCategories.Category.Community
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
Qt.callLater(() => communityAirdropsSettingsPanel.collectiblesModel = this)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
membersModel: UsersModel {}
|
2023-03-15 17:14:31 +00:00
|
|
|
|
2023-05-04 10:29:01 +00:00
|
|
|
onAirdropClicked: logs.logEvent("CommunityAirdropsSettingsPanel::onAirdropClicked")
|
|
|
|
}
|
2023-03-15 17:14:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LogsAndControlsPanel {
|
|
|
|
id: logsAndControlsPanel
|
|
|
|
|
|
|
|
SplitView.minimumHeight: 100
|
|
|
|
SplitView.preferredHeight: 150
|
|
|
|
|
|
|
|
logsView.logText: logs.logText
|
|
|
|
}
|
|
|
|
}
|