From 4744fd15f79b8e2a990da7438c089bf2e73756e5 Mon Sep 17 00:00:00 2001 From: nolim1t Date: Wed, 14 Oct 2020 21:35:49 +0700 Subject: [PATCH 1/4] Add LNInvoiceWindow --- src/components/LNInvoiceWindow.jsx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/components/LNInvoiceWindow.jsx diff --git a/src/components/LNInvoiceWindow.jsx b/src/components/LNInvoiceWindow.jsx new file mode 100644 index 0000000..53a6b20 --- /dev/null +++ b/src/components/LNInvoiceWindow.jsx @@ -0,0 +1,27 @@ +import React from 'react'; +import PropTypes from 'prop-types'; + +const LNInvoiceWindow = ({ bolt11 }) => { + console.log("LNInvoiceWindow"); + console.log(bolt11); + + function copythis() { + document.execCommand("copy"); + } + + function selecttextarea() { + document.getElementById("lndtextarea").select(); + } + return ( + + ); +}; + +LNInvoiceWindow.propTypes = { + bolt11: PropTypes.string.isRequired, +}; + + +export default LNInvoiceWindow; From e72de19f2c857f621890ea4cb98704caaf54f0cc Mon Sep 17 00:00:00 2001 From: nolim1t Date: Wed, 14 Oct 2020 21:36:25 +0700 Subject: [PATCH 2/4] Add QR Code view --- src/components/QRCodeView.jsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/components/QRCodeView.jsx b/src/components/QRCodeView.jsx index 4059840..d169cad 100644 --- a/src/components/QRCodeView.jsx +++ b/src/components/QRCodeView.jsx @@ -1,6 +1,7 @@ import React from 'react'; import QRCode from 'qrcode.react'; import PropTypes from 'prop-types'; +import LNInvoiceWindow from './LNInvoiceWindow'; const QRCodeView = ({ address, amount, bolt11, qrCodeType }) => { let uri = `bitcoin:${address}?amount=${amount}&lightning=${bolt11}`; @@ -10,9 +11,23 @@ const QRCodeView = ({ address, amount, bolt11, qrCodeType }) => { uri = `lightning:${bolt11}`; } + function clickTest() { + //document.write(bolt11); + console.log("copying bolt11 to clipboard") + document.getElementById("bolt11value").value = bolt11; + console.log(document.getElementById("bolt11value").value); + //document.execCommand("copy"); + } + return (
- +
+
+ +
+
+ +
); }; @@ -24,4 +39,5 @@ QRCodeView.propTypes = { qrCodeType: PropTypes.string.isRequired, }; + export default QRCodeView; From 66db0822cef94f8e4c910b2fd2a08eb01cbb3168 Mon Sep 17 00:00:00 2001 From: nolim1t Date: Wed, 14 Oct 2020 21:37:37 +0700 Subject: [PATCH 3/4] Change text --- src/components/PaymentController.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/PaymentController.jsx b/src/components/PaymentController.jsx index 50c4798..b8a3d9d 100644 --- a/src/components/PaymentController.jsx +++ b/src/components/PaymentController.jsx @@ -155,6 +155,8 @@ class PaymentController extends Component { ); case paymentEnum.REQUESTING_PAYMENT: + var displayedMessage = "Please scan QR or send to the following invoice"; + console.log(displayedMessage); return (
@@ -172,7 +174,7 @@ class PaymentController extends Component { bolt11={this.state.invoice.bolt11} qrCodeType={this.state.qrCodeType} /> - +
); case paymentEnum.PAID: From d141bd5313ed950883db67b034303cbdcc4a828d Mon Sep 17 00:00:00 2001 From: nolim1t Date: Wed, 14 Oct 2020 21:50:53 +0700 Subject: [PATCH 4/4] Add scaling for mobile devices --- src/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index 2d9b69e..c335c09 100644 --- a/src/index.html +++ b/src/index.html @@ -2,7 +2,7 @@ - +