qml: add lnurl-pay comment feature
This commit is contained in:
@@ -11,10 +11,9 @@ ElDialog {
|
||||
id: dialog
|
||||
|
||||
title: qsTr('LNURL Payment request')
|
||||
iconSource: '../../../icons/link.png'
|
||||
|
||||
// property var lnurlData
|
||||
property InvoiceParser invoiceParser
|
||||
// property alias lnurlData: dialog.invoiceParser.lnurlData
|
||||
|
||||
standardButtons: Dialog.Cancel
|
||||
|
||||
@@ -26,24 +25,30 @@ ElDialog {
|
||||
|
||||
GridLayout {
|
||||
columns: 2
|
||||
implicitWidth: parent.width
|
||||
|
||||
width: parent.width
|
||||
|
||||
Label {
|
||||
text: qsTr('Provider')
|
||||
color: Material.accentColor
|
||||
}
|
||||
Label {
|
||||
text: invoiceParser.lnurlData['domain']
|
||||
}
|
||||
Label {
|
||||
text: qsTr('Description')
|
||||
color: Material.accentColor
|
||||
}
|
||||
Label {
|
||||
text: invoiceParser.lnurlData['metadata_plaintext']
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
Label {
|
||||
text: invoiceParser.lnurlData['min_sendable_sat'] == invoiceParser.lnurlData['max_sendable_sat']
|
||||
? qsTr('Amount')
|
||||
: qsTr('Amount range')
|
||||
color: Material.accentColor
|
||||
}
|
||||
Label {
|
||||
text: invoiceParser.lnurlData['min_sendable_sat'] == invoiceParser.lnurlData['max_sendable_sat']
|
||||
@@ -53,12 +58,21 @@ ElDialog {
|
||||
: invoiceParser.lnurlData['min_sendable_sat'] + ' < amount < ' + invoiceParser.lnurlData['max_sendable_sat']
|
||||
}
|
||||
|
||||
TextArea {
|
||||
id: comment
|
||||
Layout.columnSpan: 2
|
||||
Layout.preferredWidth: parent.width
|
||||
Layout.minimumHeight: 80
|
||||
wrapMode: TextEdit.Wrap
|
||||
placeholderText: qsTr('Enter an (optional) message for the receiver')
|
||||
}
|
||||
|
||||
Button {
|
||||
Layout.columnSpan: 2
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
text: qsTr('Proceed')
|
||||
onClicked: {
|
||||
invoiceParser.lnurlGetInvoice(invoiceParser.lnurlData['min_sendable_sat'])
|
||||
invoiceParser.lnurlGetInvoice(invoiceParser.lnurlData['min_sendable_sat'], comment.text)
|
||||
dialog.close()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user