fix qr layout shift

This commit is contained in:
keyan 2023-08-11 16:52:24 -05:00
parent 73aa0d2d44
commit 63dd5d4d09
3 changed files with 6 additions and 5 deletions

View File

@ -118,7 +118,7 @@ const ActionInvoice = ({ id, hash, hmac, errorCount, repeat, ...props }) => {
return <div>error</div> return <div>error</div>
} }
if (!data || loading) { if (!data || loading) {
return <QrSkeleton status='loading' /> return <QrSkeleton description status='loading' />
} }
let errorStatus = 'Something went wrong trying to perform the action after payment.' let errorStatus = 'Something went wrong trying to perform the action after payment.'

View File

@ -37,11 +37,12 @@ export default function Qr ({ asIs, value, webLn, statusVariant, description, st
) )
} }
export function QrSkeleton ({ status }) { export function QrSkeleton ({ status, description }) {
return ( return (
<> <>
<div className='h-auto w-100 clouds' style={{ paddingTop: 'min(300px + 2rem, 100%)', maxWidth: 'calc(300px + 2rem)' }} /> <div className='h-auto mx-auto w-100 clouds' style={{ paddingTop: 'min(300px, 100%)', maxWidth: 'calc(300px)' }} />
<div className='mt-3 w-100'> {description && <div className='mt-1 fst-italic text-center text-muted invisible'>.</div>}
<div className='my-3 w-100'>
<InputSkeleton /> <InputSkeleton />
</div> </div>
<InvoiceStatus variant='default' status={status} /> <InvoiceStatus variant='default' status={status} />

View File

@ -19,7 +19,7 @@ export default function FullInvoice () {
return ( return (
<CenterLayout> <CenterLayout>
{error && <div>{error.toString()}</div>} {error && <div>{error.toString()}</div>}
{data ? <Invoice invoice={data.invoice} /> : <QrSkeleton status='loading' />} {data ? <Invoice invoice={data.invoice} /> : <QrSkeleton description status='loading' />}
</CenterLayout> </CenterLayout>
) )
} }