mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-24 05:21:58 +00:00
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
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (root.state === Constants.addressRequested) {
|
if (root.state === Constants.addressRequested) {
|
||||||
// TODO get address from a modal instead
|
selectAccountModal.open()
|
||||||
chatsModel.acceptRequestAddressForTransaction(messageId, walletModel.getDefaultAccount())
|
|
||||||
} else if (root.state === Constants.transactionRequested) {
|
} else if (root.state === Constants.transactionRequested) {
|
||||||
signTransactionModal.open()
|
signTransactionModal.open()
|
||||||
}
|
}
|
||||||
@ -97,6 +96,14 @@ Item {
|
|||||||
selectedFiatAmount: fiatValue
|
selectedFiatAmount: fiatValue
|
||||||
//outgoing: root.outgoing
|
//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…
x
Reference in New Issue
Block a user