refactor(SelectAccountModal): use StatusQ components to build modal

This commit is contained in:
Pascal Precht 2021-10-18 14:50:47 +02:00 committed by Iuri Matias
parent 1de75c514e
commit 2d89a815f4
1 changed files with 31 additions and 33 deletions

View File

@ -4,47 +4,45 @@ import QtQuick.Layouts 1.13
import QtQuick.Dialogs 1.3
import utils 1.0
import "../../../../shared"
import "../../../../shared/controls"
import "../../../../shared/popups"
import "../../../../shared/status"
// TODO: replace with StatusModal
ModalPopup {
import StatusQ.Popups 0.1
import StatusQ.Controls 0.1
import "../../../../shared/controls"
StatusModal {
id: root
//% "Select account"
title: qsTrId("select-account")
header.title: qsTrId("select-account")
height: 284
property alias accountSelector: selectFromAccount
signal selectAndShareAddressButtonClicked()
TransactionFormGroup {
anchors.fill: parent
anchors.leftMargin: Style.current.padding
anchors.rightMargin: Style.current.padding
AccountSelector {
id: selectFromAccount
accounts: walletModel.accountsView.accounts
currency: walletModel.balanceView.defaultCurrency
width: parent.width
//% "Choose account"
//% "Select account to share and receive assets"
label: qsTrId("select-account-to-share-and-receive-assets")
}
}
contentItem: Item {
width: root.width
height: childrenRect.height
footer: Item {
id: footerContainer
width: parent.width
height: children[0].height
StatusButton {
anchors.right: parent.right
anchors.rightMargin: Style.current.smallPadding
//% "Confirm and share address"
text: qsTrId("confirm-and-share-address")
anchors.bottom: parent.bottom
onClicked: root.selectAndShareAddressButtonClicked()
TransactionFormGroup {
anchors.fill: parent
anchors.leftMargin: Style.current.padding
anchors.rightMargin: Style.current.padding
StatusAccountSelector {
id: selectFromAccount
accounts: walletModel.accountsView.accounts
currency: walletModel.balanceView.defaultCurrency
width: parent.width
//% "Choose account"
//% "Select account to share and receive assets"
label: qsTrId("select-account-to-share-and-receive-assets")
}
}
}
rightButtons: [
StatusButton {
//% "Confirm and share address"
text: qsTrId("confirm-and-share-address")
onClicked: root.selectAndShareAddressButtonClicked()
}
]
}