feat: allow users to select account when sharing address for tx
Closes #1207
This commit is contained in:
parent
fc5f7e8270
commit
43e978d205
|
@ -35,8 +35,7 @@ Item {
|
|||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
if (root.state === Constants.addressRequested) {
|
||||
// TODO get address from a modal instead
|
||||
chatsModel.acceptRequestAddressForTransaction(messageId, walletModel.getDefaultAccount())
|
||||
selectAccountModal.open()
|
||||
} else if (root.state === Constants.transactionRequested) {
|
||||
signTransactionModal.open()
|
||||
}
|
||||
|
@ -97,6 +96,14 @@ Item {
|
|||
selectedFiatAmount: fiatValue
|
||||
//outgoing: root.outgoing
|
||||
}
|
||||
|
||||
SelectAccountModal {
|
||||
id: selectAccountModal
|
||||
onSelectAndShareAddressButtonClicked: {
|
||||
chatsModel.acceptRequestAddressForTransaction(messageId, accountSelector.selectedAccount)
|
||||
selectAccountModal.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*##^##
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import QtQuick.Layouts 1.13
|
||||
import QtQuick.Dialogs 1.3
|
||||
import "../../../../../../imports"
|
||||
import "../../../../../../shared"
|
||||
import "../../../../../../shared/status"
|
||||
|
||||
ModalPopup {
|
||||
id: root
|
||||
title: qsTr("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.accounts
|
||||
currency: walletModel.defaultCurrency
|
||||
width: parent.width
|
||||
//% "Choose account"
|
||||
label: qsTr("Select account to share and receive assets")
|
||||
reset: function() {
|
||||
accounts = Qt.binding(function() { return walletModel.accounts })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
footer: Item {
|
||||
id: footerContainer
|
||||
width: parent.width
|
||||
height: children[0].height
|
||||
|
||||
StatusButton {
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Style.current.smallPadding
|
||||
text: qsTr("Confirm and share address")
|
||||
anchors.bottom: parent.bottom
|
||||
onClicked: root.selectAndShareAddressButtonClicked()
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue