mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-17 00:56:39 +00:00
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
|
||||
|
||||
CommunityNewCollectibleView {
|
||||
//anchors.fill: parent
|
||||
viewWidth: root.viewWidth
|
||||
layer1Networks: root.layer1Networks
|
||||
layer2Networks: root.layer2Networks
|
||||
@ -148,6 +147,7 @@ SettingsPageLayout {
|
||||
allNetworks: root.allNetworks
|
||||
|
||||
onPreviewClicked: {
|
||||
d.collectibleName = name
|
||||
stackManager.push(d.previewCollectibleViewState,
|
||||
collectibleView,
|
||||
{
|
||||
@ -172,13 +172,12 @@ SettingsPageLayout {
|
||||
id: collectibleView
|
||||
|
||||
CommunityCollectibleView {
|
||||
id: collectibleViewItem
|
||||
//anchors.fill: parent
|
||||
viewWidth: root.viewWidth
|
||||
preview: d.preview
|
||||
holdersModel: root.holdersModel
|
||||
|
||||
onMintCollectible: {
|
||||
d.collectibleName = name
|
||||
root.mintCollectible(artworkSource,
|
||||
name,
|
||||
symbol,
|
||||
@ -191,13 +190,6 @@ SettingsPageLayout {
|
||||
|
||||
stackManager.clear(d.initialViewState, StackView.Immediate)
|
||||
}
|
||||
|
||||
Binding {
|
||||
target: d
|
||||
property: "collectibleName"
|
||||
value: collectibleViewItem.name
|
||||
restoreMode: Binding.RestoreBindingOrValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -212,33 +204,23 @@ SettingsPageLayout {
|
||||
}
|
||||
}
|
||||
|
||||
// TEMPORAL:
|
||||
Component {
|
||||
id: mintedTokensView
|
||||
|
||||
// TEMPORAL:
|
||||
Item {
|
||||
id: mintedTokensViewItem
|
||||
width: root.viewWidth
|
||||
//anchors.fill: parent
|
||||
|
||||
ColumnLayout {
|
||||
id: backendChecker
|
||||
width: parent.width
|
||||
|
||||
CommunityMintedTokensView {
|
||||
viewWidth: root.viewWidth
|
||||
model: root.tokensModel
|
||||
onItemClicked: {
|
||||
selectedCollectibleName = name
|
||||
d.collectibleName = name
|
||||
stackManager.push(d.collectibleViewState,
|
||||
collectibleView,
|
||||
{
|
||||
"deployState": Qt.binding(() => deployState),
|
||||
deployState: Qt.binding(() => deployState),
|
||||
name,
|
||||
artworkSource,
|
||||
symbol,
|
||||
description,
|
||||
"supplyText": supply.toString(),
|
||||
supplyText: supply.toString(),
|
||||
infiniteSupply,
|
||||
transferable,
|
||||
remoteSelfDestruct,
|
||||
@ -248,13 +230,6 @@ SettingsPageLayout {
|
||||
},
|
||||
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
|
||||
|
||||
label: qsTr("Token symbol")
|
||||
charLimit: 5
|
||||
placeholderText: qsTr("Letter token abbreviation e.g. ABC")
|
||||
errorText: qsTr("Token symbol")
|
||||
}
|
||||
@ -226,6 +227,7 @@ StatusScrollView {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Style.current.padding
|
||||
Layout.bottomMargin: Style.current.padding
|
||||
text: qsTr("Preview")
|
||||
enabled: d.isFullyFilled
|
||||
|
||||
|
@ -1,8 +1,9 @@
|
||||
ChannelsSelectionModel 1.0 ChannelsSelectionModel.qml
|
||||
CommunityCollectibleView 1.0 CommunityCollectibleView.qml
|
||||
CommunityMintedTokensView 1.0 CommunityMintedTokensView.qml
|
||||
CommunityNewCollectibleView 1.0 CommunityNewCollectibleView.qml
|
||||
CommunityNewPermissionView 1.0 CommunityNewPermissionView.qml
|
||||
CommunityPermissionsView 1.0 CommunityPermissionsView.qml
|
||||
CommunityWelcomeSettingsView 1.0 CommunityWelcomeSettingsView.qml
|
||||
HoldingsSelectionModel 1.0 HoldingsSelectionModel.qml
|
||||
JoinCommunityView 1.0 JoinCommunityView.qml
|
||||
JoinCommunityView 1.0 JoinCommunityView.qml
|
||||
|
1
ui/app/AppLayouts/Wallet/views/collectibles/qmldir
Normal file
1
ui/app/AppLayouts/Wallet/views/collectibles/qmldir
Normal file
@ -0,0 +1 @@
|
||||
CollectibleView 1.0 CollectibleView.qml
|
Loading…
x
Reference in New Issue
Block a user