only show invoice data on full page

This commit is contained in:
keyan 2023-10-23 19:58:33 -05:00
parent a85af82460
commit 0c9131f698

View File

@ -14,7 +14,7 @@ import Countdown from './countdown'
import PayerData from './payer-data' import PayerData from './payer-data'
import Bolt11Info from './bolt11-info' import Bolt11Info from './bolt11-info'
export function Invoice ({ invoice, onPayment, info, successVerb }) { export function Invoice ({ invoice, modal, onPayment, info, successVerb }) {
const [expired, setExpired] = useState(new Date(invoice.expiredAt) <= new Date()) const [expired, setExpired] = useState(new Date(invoice.expiredAt) <= new Date())
let variant = 'default' let variant = 'default'
@ -57,36 +57,40 @@ export function Invoice ({ invoice, onPayment, info, successVerb }) {
}} }}
/> />
</div>} </div>}
{info && <div className='text-muted fst-italic text-center'>{info}</div>} {!modal &&
<div className='w-100'> <>
{nostr {info && <div className='text-muted fst-italic text-center'>{info}</div>}
? <AccordianItem <div className='w-100'>
header='Nostr Zap Request' {nostr
body={ ? <AccordianItem
<pre> header='Nostr Zap Request'
<code> body={
{JSON.stringify(nostr, null, 2)} <pre>
</code> <code>
</pre> {JSON.stringify(nostr, null, 2)}
</code>
</pre>
} }
/> />
: null} : null}
</div> </div>
{lud18Data && {lud18Data &&
<div className='w-100'> <div className='w-100'>
<AccordianItem <AccordianItem
header='sender information' header='sender information'
body={<PayerData data={lud18Data} className='text-muted ms-3 mb-3' />} body={<PayerData data={lud18Data} className='text-muted ms-3 mb-3' />}
/> />
</div>} </div>}
{comment && {comment &&
<div className='w-100'> <div className='w-100'>
<AccordianItem <AccordianItem
header='sender comments' header='sender comments'
body={<span className='text-muted ms-3'>{comment}</span>} body={<span className='text-muted ms-3'>{comment}</span>}
/> />
</div>} </div>}
<Bolt11Info bolt11={bolt11} preimage={confirmedPreimage} /> <Bolt11Info bolt11={bolt11} preimage={confirmedPreimage} />
</>}
</> </>
) )
} }
@ -120,7 +124,7 @@ const MutationInvoice = ({ id, hash, hmac, errorCount, repeat, onClose, expiresA
return ( return (
<> <>
<Invoice invoice={data.invoice} {...props} /> <Invoice invoice={data.invoice} modal {...props} />
{errorCount > 0 {errorCount > 0
? ( ? (
<> <>