Skip to content

Commit

Permalink
qml: Start AddWallet flow when AddWalletButton is clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
johnny9 committed Aug 24, 2024
1 parent cb72dd2 commit e7747b2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/qml/pages/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ ApplicationWindow {
optionsModel.onboard()
if (AppMode.walletEnabled && AppMode.isDesktop) {
main.push(desktopWallets)
main.push(addWallet)
main.push(addWalletFlow)
} else {
main.push(node)
}
Expand All @@ -91,11 +91,15 @@ ApplicationWindow {

Component {
id: desktopWallets
DesktopWallets {}
DesktopWallets {
onAddWallet: {
main.push(addWalletFlow)
}
}
}

Component {
id: addWallet
id: addWalletFlow
AddWallet {
onFinished: {
main.pop()
Expand Down
6 changes: 6 additions & 0 deletions src/qml/pages/wallet/DesktopWallets.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Page {

ButtonGroup { id: navigationTabs }

signal addWallet()

header: NavigationBar2 {
id: navBar
leftItem: WalletBadge {
Expand All @@ -40,6 +42,10 @@ Page {
closePolicy: Popup.CloseOnPressOutside
x: 0
y: parent.height

onAddWallet: {
root.addWallet()
}
}
}
centerItem: RowLayout {
Expand Down
6 changes: 6 additions & 0 deletions src/qml/pages/wallet/WalletSelect.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Popup {
implicitWidth: 250
clip: true

signal addWallet()

background: Item {
anchors.fill: parent
Rectangle {
Expand Down Expand Up @@ -89,6 +91,10 @@ Popup {

AddWalletButton {
id: addWallet
onClicked: {
root.addWallet()
root.close()
}
}
}
}

0 comments on commit e7747b2

Please sign in to comment.