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,6 +57,8 @@ export function Invoice ({ invoice, onPayment, info, successVerb }) {
}} }}
/> />
</div>} </div>}
{!modal &&
<>
{info && <div className='text-muted fst-italic text-center'>{info}</div>} {info && <div className='text-muted fst-italic text-center'>{info}</div>}
<div className='w-100'> <div className='w-100'>
{nostr {nostr
@ -87,6 +89,8 @@ export function Invoice ({ invoice, onPayment, info, successVerb }) {
/> />
</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
? ( ? (
<> <>