diff --git a/src/element/Invoice.js b/src/element/Invoice.js index f96a7b0ba..cba16ab87 100644 --- a/src/element/Invoice.js +++ b/src/element/Invoice.js @@ -1,15 +1,18 @@ import "./Invoice.css"; +import { useState } from "react"; import { decode as invoiceDecode } from "light-bolt11-decoder"; import { useMemo } from "react"; import NoteTime from "./NoteTime"; +import QrCode from "./QrCode"; export default function Invoice(props) { const invoice = props.invoice; + const [showLnQr, setShowLnQr] = useState(false); const info = useMemo(() => { try { let parsed = invoiceDecode(invoice); - + let amount = parseInt(parsed.sections.find(a => a.name === "amount")?.value); let timestamp = parseInt(parsed.sections.find(a => a.name === "timestamp")?.value); let expire = parseInt(parsed.sections.find(a => a.name === "expiry")?.value); @@ -34,15 +37,28 @@ export default function Invoice(props) { <>
{info?.description}
+ { showLnQr ?