feat(HoldingsDropdown): Enable navigation to mint tokens settings section

It enables navigation from holdings dropdown to mint tokens settings view.
This commit is contained in:
Noelia 2023-03-24 13:41:46 +01:00 committed by Noelia
parent 575ee6a226
commit b3af519476
7 changed files with 34 additions and 3 deletions

View File

@ -30,6 +30,7 @@ Item {
signal itemClicked(string key, string name, url iconSource)
signal navigateDeep(string key, var subItems)
signal layoutChanged()
signal navigateToMintTokenSettings
implicitHeight: content.implicitHeight
implicitWidth: content.implicitWidth
@ -435,9 +436,7 @@ Item {
checkedKeys: root.checkedKeys
searchMode: d.searchMode
onHeaderItemClicked: {
if(key === "MINT") console.log("TODO: Mint collectible")
}
onHeaderItemClicked: root.navigateToMintTokenSettings()
onItemClicked: {
if(subItems && root.state === d.depth1_ListState) {
// One deep navigation

View File

@ -45,6 +45,7 @@ StatusDropdown {
signal updateEns(string domain)
signal removeClicked
signal navigateToMintTokenSettings
enum FlowType {
Selected, List_Deep1, List_Deep2
@ -299,6 +300,8 @@ StatusDropdown {
d.currentSubItems)
}
onNavigateToMintTokenSettings: root.navigateToMintTokenSettings()
Connections {
target: backButton

View File

@ -20,6 +20,7 @@ SettingsPageLayout {
property int viewWidth: 560 // by design
signal airdropClicked(var airdropTokens, string address)
signal navigateToMintTokenSettings
// TODO: Update with stackmanager when #8736 is integrated
function navigateBack() {
@ -98,6 +99,7 @@ SettingsPageLayout {
root.airdropClicked(airdropTokens, address)
stackManager.clear(d.welcomeViewState, StackView.Immediate)
}
onNavigateToMintTokenSettings: root.navigateToMintTokenSettings()
}
}
}

View File

@ -31,6 +31,8 @@ SettingsPageLayout {
signal removePermissionRequested(string key)
signal navigateToMintTokenSettings
function navigateBack() {
if (root.state === d.newPermissionViewState) {
root.state = d.initialState
@ -245,6 +247,8 @@ SettingsPageLayout {
root.state = d.permissionsViewState
}
onNavigateToMintTokenSettings: root.navigateToMintTokenSettings()
Connections {
target: d

View File

@ -280,6 +280,8 @@ StatusSectionLayout {
permissionsStore.removePermission(key)
onPreviousPageNameChanged: root.backButtonName = previousPageName
onNavigateToMintTokenSettings: d.currentIndex = d.mintTokensSettingsIndex
}
CommunityMintTokensSettingsPanel {
@ -314,6 +316,12 @@ StatusSectionLayout {
accountName)
}
Binding {
target: d
property: "mintTokensSettingsIndex"
value: communityMintTokensSettingsPanel.StackView.index
}
// TODO: Review once backend is done
Connections {
target: rootStore.communityTokensStore
@ -333,6 +341,7 @@ StatusSectionLayout {
onPreviousPageNameChanged: root.backButtonName = previousPageName
onAirdropClicked: communityTokensStore.airdrop(airdropTokens, chainId, address)
onNavigateToMintTokenSettings: d.currentIndex = d.mintTokensSettingsIndex
}
onCurrentIndexChanged: root.backButtonName = centerPanelContentLoader.item.children[d.currentIndex].previousPageName
@ -343,7 +352,9 @@ StatusSectionLayout {
QtObject {
id: d
property int currentIndex: 0
property int mintTokensSettingsIndex
}
MessageDialog {

View File

@ -32,6 +32,7 @@ StatusScrollView {
addressess.model.count > 0
signal airdropClicked(var airdropTokens, string address)
signal navigateToMintTokenSettings
QtObject {
id: d
@ -146,6 +147,11 @@ StatusScrollView {
root.selectedHoldingsModel.remove(tokensSelector.editedIndex)
dropdown.close()
}
onNavigateToMintTokenSettings: {
root.navigateToMintTokenSettings()
close()
}
}
addButton.onClicked: {

View File

@ -56,6 +56,7 @@ StatusScrollView {
property bool permissionTypeLimitReached: false
signal createPermissionClicked
signal navigateToMintTokenSettings
function resetChanges() {
d.loadInitValues()
@ -286,6 +287,11 @@ StatusScrollView {
d.dirtyValues.selectedHoldingsModel.remove(tokensSelector.editedIndex)
dropdown.close()
}
onNavigateToMintTokenSettings: {
root.navigateToMintTokenSettings()
close()
}
}
addButton.onClicked: {