feat(MintTokens): Added list of collectibles view
Added list of collectibles view. Closes #8736
This commit is contained in:
parent
79a1a60c70
commit
e8b1dad80f
|
@ -139,7 +139,6 @@ SettingsPageLayout {
|
||||||
id: newCollectiblesView
|
id: newCollectiblesView
|
||||||
|
|
||||||
CommunityNewCollectibleView {
|
CommunityNewCollectibleView {
|
||||||
//anchors.fill: parent
|
|
||||||
viewWidth: root.viewWidth
|
viewWidth: root.viewWidth
|
||||||
layer1Networks: root.layer1Networks
|
layer1Networks: root.layer1Networks
|
||||||
layer2Networks: root.layer2Networks
|
layer2Networks: root.layer2Networks
|
||||||
|
@ -148,6 +147,7 @@ SettingsPageLayout {
|
||||||
allNetworks: root.allNetworks
|
allNetworks: root.allNetworks
|
||||||
|
|
||||||
onPreviewClicked: {
|
onPreviewClicked: {
|
||||||
|
d.collectibleName = name
|
||||||
stackManager.push(d.previewCollectibleViewState,
|
stackManager.push(d.previewCollectibleViewState,
|
||||||
collectibleView,
|
collectibleView,
|
||||||
{
|
{
|
||||||
|
@ -172,13 +172,12 @@ SettingsPageLayout {
|
||||||
id: collectibleView
|
id: collectibleView
|
||||||
|
|
||||||
CommunityCollectibleView {
|
CommunityCollectibleView {
|
||||||
id: collectibleViewItem
|
|
||||||
//anchors.fill: parent
|
|
||||||
viewWidth: root.viewWidth
|
viewWidth: root.viewWidth
|
||||||
preview: d.preview
|
preview: d.preview
|
||||||
holdersModel: root.holdersModel
|
holdersModel: root.holdersModel
|
||||||
|
|
||||||
onMintCollectible: {
|
onMintCollectible: {
|
||||||
|
d.collectibleName = name
|
||||||
root.mintCollectible(artworkSource,
|
root.mintCollectible(artworkSource,
|
||||||
name,
|
name,
|
||||||
symbol,
|
symbol,
|
||||||
|
@ -191,13 +190,6 @@ SettingsPageLayout {
|
||||||
|
|
||||||
stackManager.clear(d.initialViewState, StackView.Immediate)
|
stackManager.clear(d.initialViewState, StackView.Immediate)
|
||||||
}
|
}
|
||||||
|
|
||||||
Binding {
|
|
||||||
target: d
|
|
||||||
property: "collectibleName"
|
|
||||||
value: collectibleViewItem.name
|
|
||||||
restoreMode: Binding.RestoreBindingOrValue
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,33 +204,23 @@ SettingsPageLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TEMPORAL:
|
|
||||||
Component {
|
Component {
|
||||||
id: mintedTokensView
|
id: mintedTokensView
|
||||||
|
|
||||||
// TEMPORAL:
|
CommunityMintedTokensView {
|
||||||
Item {
|
|
||||||
id: mintedTokensViewItem
|
|
||||||
width: root.viewWidth
|
|
||||||
//anchors.fill: parent
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: backendChecker
|
|
||||||
width: parent.width
|
|
||||||
|
|
||||||
viewWidth: root.viewWidth
|
viewWidth: root.viewWidth
|
||||||
model: root.tokensModel
|
model: root.tokensModel
|
||||||
onItemClicked: {
|
onItemClicked: {
|
||||||
selectedCollectibleName = name
|
d.collectibleName = name
|
||||||
stackManager.push(d.collectibleViewState,
|
stackManager.push(d.collectibleViewState,
|
||||||
collectibleView,
|
collectibleView,
|
||||||
{
|
{
|
||||||
"deployState": Qt.binding(() => deployState),
|
deployState: Qt.binding(() => deployState),
|
||||||
name,
|
name,
|
||||||
artworkSource,
|
artworkSource,
|
||||||
symbol,
|
symbol,
|
||||||
description,
|
description,
|
||||||
"supplyText": supply.toString(),
|
supplyText: supply.toString(),
|
||||||
infiniteSupply,
|
infiniteSupply,
|
||||||
transferable,
|
transferable,
|
||||||
remoteSelfDestruct,
|
remoteSelfDestruct,
|
||||||
|
@ -248,13 +230,6 @@ SettingsPageLayout {
|
||||||
},
|
},
|
||||||
StackView.Immediate)
|
StackView.Immediate)
|
||||||
}
|
}
|
||||||
|
|
||||||
Binding {
|
|
||||||
target: d
|
|
||||||
property: "collectibleName"
|
|
||||||
value: mintedTokensViewItem.model.name
|
|
||||||
restoreMode: Binding.RestoreBindingOrValue
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,103 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
import QtQuick.Layouts 1.14
|
||||||
|
|
||||||
|
import StatusQ.Core 0.1
|
||||||
|
import StatusQ.Components 0.1
|
||||||
|
import StatusQ.Core.Theme 0.1
|
||||||
|
|
||||||
|
import utils 1.0
|
||||||
|
|
||||||
|
import AppLayouts.Wallet.views.collectibles 1.0
|
||||||
|
|
||||||
|
StatusScrollView {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property int viewWidth: 560 // by design
|
||||||
|
property var model
|
||||||
|
|
||||||
|
signal itemClicked(int deployState,
|
||||||
|
string name,
|
||||||
|
string artworkSource,
|
||||||
|
string symbol,
|
||||||
|
string description,
|
||||||
|
int supply,
|
||||||
|
bool infiniteSupply,
|
||||||
|
bool transferable,
|
||||||
|
bool remoteSelfDestruct,
|
||||||
|
int chainId,
|
||||||
|
string chainName,
|
||||||
|
string chainIcon)
|
||||||
|
|
||||||
|
|
||||||
|
enum DeployState {
|
||||||
|
Failed,
|
||||||
|
InProgress,
|
||||||
|
Deployed
|
||||||
|
}
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: d
|
||||||
|
|
||||||
|
function getStateText(deployState) {
|
||||||
|
if(deployState === CommunityMintedTokensView.DeployState.Failed) {
|
||||||
|
return qsTr("Failed")
|
||||||
|
}
|
||||||
|
|
||||||
|
if(deployState === CommunityMintedTokensView.DeployState.InProgress) {
|
||||||
|
return qsTr("Minting...")
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
contentWidth: mainLayout.width
|
||||||
|
contentHeight: mainLayout.height
|
||||||
|
padding: 0
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
id: mainLayout
|
||||||
|
|
||||||
|
width: root.viewWidth
|
||||||
|
spacing: Style.current.padding
|
||||||
|
|
||||||
|
StatusBaseText {
|
||||||
|
text: qsTr("Collectibles")
|
||||||
|
font.pixelSize: Theme.primaryTextFontSize
|
||||||
|
color: Theme.palette.baseColor1
|
||||||
|
}
|
||||||
|
|
||||||
|
StatusGridView {
|
||||||
|
id: gridView
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: 500 // TODO
|
||||||
|
model: root.model
|
||||||
|
cellHeight: 229
|
||||||
|
cellWidth: 176
|
||||||
|
delegate: CollectibleView {
|
||||||
|
height: gridView.cellHeight
|
||||||
|
width: gridView.cellWidth
|
||||||
|
title: model.name ? model.name : "..."
|
||||||
|
subTitle: d.getStateText(model.deployState)
|
||||||
|
imageUrl: model.image ? model.image : ""
|
||||||
|
backgroundColor: model.backgroundColor ? model.backgroundColor : "transparent" // TODO BACKEND
|
||||||
|
isLoading: false// model.isLoading // TODO BACKEND
|
||||||
|
navigationIconVisible: true
|
||||||
|
|
||||||
|
onClicked: root.itemClicked(model.deployState,
|
||||||
|
model.name,
|
||||||
|
model.image,
|
||||||
|
model.symbol,
|
||||||
|
model.description,
|
||||||
|
model.supply,
|
||||||
|
model.infiniteSupply,
|
||||||
|
model.transferable,
|
||||||
|
model.remoteSelfDestruct,
|
||||||
|
model.chainId,
|
||||||
|
"Goerli", //model.chainName, TODO BACKEND
|
||||||
|
"network/Network=Custom")//model.chainIcon) TODO BACKEND
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -120,6 +120,7 @@ StatusScrollView {
|
||||||
id: symbolInput
|
id: symbolInput
|
||||||
|
|
||||||
label: qsTr("Token symbol")
|
label: qsTr("Token symbol")
|
||||||
|
charLimit: 5
|
||||||
placeholderText: qsTr("Letter token abbreviation e.g. ABC")
|
placeholderText: qsTr("Letter token abbreviation e.g. ABC")
|
||||||
errorText: qsTr("Token symbol")
|
errorText: qsTr("Token symbol")
|
||||||
}
|
}
|
||||||
|
@ -226,6 +227,7 @@ StatusScrollView {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: Style.current.padding
|
Layout.topMargin: Style.current.padding
|
||||||
|
Layout.bottomMargin: Style.current.padding
|
||||||
text: qsTr("Preview")
|
text: qsTr("Preview")
|
||||||
enabled: d.isFullyFilled
|
enabled: d.isFullyFilled
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
ChannelsSelectionModel 1.0 ChannelsSelectionModel.qml
|
ChannelsSelectionModel 1.0 ChannelsSelectionModel.qml
|
||||||
CommunityCollectibleView 1.0 CommunityCollectibleView.qml
|
CommunityCollectibleView 1.0 CommunityCollectibleView.qml
|
||||||
|
CommunityMintedTokensView 1.0 CommunityMintedTokensView.qml
|
||||||
CommunityNewCollectibleView 1.0 CommunityNewCollectibleView.qml
|
CommunityNewCollectibleView 1.0 CommunityNewCollectibleView.qml
|
||||||
CommunityNewPermissionView 1.0 CommunityNewPermissionView.qml
|
CommunityNewPermissionView 1.0 CommunityNewPermissionView.qml
|
||||||
CommunityPermissionsView 1.0 CommunityPermissionsView.qml
|
CommunityPermissionsView 1.0 CommunityPermissionsView.qml
|
||||||
CommunityWelcomeSettingsView 1.0 CommunityWelcomeSettingsView.qml
|
CommunityWelcomeSettingsView 1.0 CommunityWelcomeSettingsView.qml
|
||||||
HoldingsSelectionModel 1.0 HoldingsSelectionModel.qml
|
HoldingsSelectionModel 1.0 HoldingsSelectionModel.qml
|
||||||
JoinCommunityView 1.0 JoinCommunityView.qml
|
JoinCommunityView 1.0 JoinCommunityView.qml
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
CollectibleView 1.0 CollectibleView.qml
|
Loading…
Reference in New Issue