feat(MintingTokens): Created welcome view

- Created minting tokens welcome view.
- Added basic navigations.

Closes #8732
This commit is contained in:
Noelia 2023-02-17 12:57:17 +01:00 committed by Noelia
parent 8e9ae308d5
commit c1e3050d06
6 changed files with 95 additions and 27 deletions

View File

@ -6,18 +6,16 @@ import StatusQ.Controls 0.1
import utils 1.0
import shared.popups 1.0
import shared.stores 1.0
Item {
id: root
property var transactionStore
property var tokensModel
signal mintCollectible(string address, string name, string symbol, string description, int supply,
bool infiniteSupply, bool transferable, bool selfDestruct, string network)
readonly property var transactionStore: TransactionStore{}
ColumnLayout {
id: layout
anchors.left: parent.left

View File

@ -0,0 +1,86 @@
import QtQuick 2.14
import AppLayouts.Chat.layouts 1.0
import AppLayouts.Chat.views.communities 1.0
import utils 1.0
SettingsPageLayout {
id: root
property var tokensModel
property var transactionStore
property int viewWidth: 560 // by design
signal mintCollectible(string address, string name, string symbol, string description, int supply,
bool infiniteSupply, bool transferable, bool selfDestruct, string network)
function navigateBack() {
if (root.state === d.newCollectibleViewState) {
root.state = d.welcomeViewState
}
}
QtObject {
id: d
readonly property string welcomeViewState: "WELCOME"
readonly property string newCollectibleViewState: "NEW_COLLECTIBLE"
}
state: d.welcomeViewState
states: [
State {
name: d.welcomeViewState
PropertyChanges {target: root; title: qsTr("Mint tokens")}
PropertyChanges {target: root; previousPageName: ""}
PropertyChanges {target: root; content: welcomeView}
PropertyChanges {target: root; headerButtonVisible: true}
PropertyChanges {target: root; headerButtonText: qsTr("Create new token")}
PropertyChanges {target: root; headerWidth: root.viewWidth}
},
State {
name: d.newCollectibleViewState
PropertyChanges {target: root; title: qsTr("Create new collectible")}
PropertyChanges {target: root; previousPageName: qsTr("Mint tokens")}
PropertyChanges {target: root; content: newCollectiblesView}
PropertyChanges {target: root; headerButtonVisible: false}
PropertyChanges {target: root; headerWidth: 0}
}
]
onHeaderButtonClicked: {
if(root.state === d.welcomeViewState) {
root.state = d.newCollectibleViewState
}
}
// Mint tokens possible view contents:
Component {
id: welcomeView
CommunityWelcomeSettingsView {
viewWidth: root.viewWidth
image: Style.png("community/mint2_1")
title: qsTr("Mint community tokens")
subtitle: qsTr("You can mint custom tokens and collectibles for your community")
checkersModel: [
qsTr("Reward individual members with custom tokens for their contribution"),
qsTr("Incentivise joining, retention, moderation and desired behaviour"),
qsTr("Monetise your community by selling exclusive tokens")
]
}
}
Component {
id: newCollectiblesView
CommunityMintTokenPanel {
anchors.fill: parent
transactionStore: root.transactionStore
tokensModel: root.tokensModel
onMintCollectible: root.mintCollectible(address, name, symbol, description, supply,
infiniteSupply, transferable, selfDestruct, network)
}
}
}

View File

@ -1,21 +0,0 @@
import QtQuick 2.14
import AppLayouts.Chat.layouts 1.0
SettingsPageLayout {
id: root
property var tokensModel
signal mintCollectible(string address, string name, string symbol, string description, int supply,
bool infiniteSupply, bool transferable, bool selfDestruct, string network)
property int viewWidth: 560 // by design
CommunityMintTokenPanel {
anchors.fill: parent
tokensModel: root.tokensModel
onMintCollectible: root.mintCollectible(address, name, symbol, description, supply,
infiniteSupply, transferable, selfDestruct, network)
}
}

View File

@ -5,3 +5,4 @@ PermissionQualificationPanel 1.0 PermissionQualificationPanel.qml
PermissionConflictWarningPanel 1.0 PermissionConflictWarningPanel.qml
CommunityColumnHeaderPanel 1.0 CommunityColumnHeaderPanel.qml
JoinPermissionsOverlayPanel 1.0 JoinPermissionsOverlayPanel.qml
CommunityMintTokensSettingsPanel 1.0 CommunityMintTokensSettingsPanel.qml

View File

@ -18,6 +18,8 @@ import StatusQ.Controls.Validators 0.1
import AppLayouts.Chat.stores 1.0
import shared.stores 1.0
import "../panels/communities"
import "../popups/community"
import "../layouts"
@ -32,10 +34,9 @@ StatusSectionLayout {
property var settingsMenuModel: [{name: qsTr("Overview"), icon: "show", enabled: true},
{name: qsTr("Members"), icon: "group-chat", enabled: true},
{name: qsTr("Permissions"), icon: "objects", enabled: root.rootStore.communityPermissionsEnabled},
{name: qsTr("Tokens"), icon: "token", enabled: root.rootStore.communityTokensEnabled}]
{name: qsTr("Mint Tokens"), icon: "token", enabled: root.rootStore.communityTokensEnabled}]
// TODO: Next community settings options:
// {name: qsTr("Tokens"), icon: "token"},
// {name: qsTr("Airdrops"), icon: "airdrop"},
// {name: qsTr("Token sales"), icon: "token-sale"},
// {name: qsTr("Subscriptions"), icon: "subscription"},
@ -45,6 +46,7 @@ StatusSectionLayout {
property var chatCommunitySectionModule
property var communityStore: CommunitiesStore {}
property bool hasAddedContacts: false
property var transactionStore: TransactionStore {}
readonly property string filteredSelectedTags: {
var tagsArray = []
@ -249,12 +251,14 @@ StatusSectionLayout {
onPreviousPageNameChanged: root.backButtonName = previousPageName
}
CommunityTokensPanel {
CommunityMintTokensSettingsPanel {
transactionStore: root.transactionStore
tokensModel: root.communityStore.mintTokensModel
onMintCollectible: {
root.communityStore.mintCollectible(address, name, symbol, description, supply,
infiniteSupply, transferable, selfDestruct, network)
}
onPreviousPageNameChanged: root.backButtonName = previousPageName
}
onCurrentIndexChanged: root.backButtonName = centerPanelContentLoader.item.children[d.currentIndex].previousPageName

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB