mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2025-08-27 04:59:22 +00:00
functional fix for drawer height bug on mobile
This commit is contained in:
parent
4c129251c7
commit
7c9f3cb797
@ -334,6 +334,21 @@ export function ZapDialog({ target, children, className }: ZapDialogProps) {
|
|||||||
}
|
}
|
||||||
}, [open, setInvoice]);
|
}, [open, setInvoice]);
|
||||||
|
|
||||||
|
// Force drawer to expand to full height when showing invoice on mobile
|
||||||
|
useEffect(() => {
|
||||||
|
if (isMobile && open && invoice) {
|
||||||
|
// Use requestAnimationFrame to ensure DOM is ready
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
const drawerContent = document.querySelector('[data-testid="zap-modal"]') as HTMLElement;
|
||||||
|
if (drawerContent) {
|
||||||
|
// Force the drawer to full height
|
||||||
|
drawerContent.style.height = '100%';
|
||||||
|
drawerContent.style.maxHeight = '95vh';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [isMobile, open, invoice]);
|
||||||
|
|
||||||
const handleZap = () => {
|
const handleZap = () => {
|
||||||
const finalAmount = typeof amount === 'string' ? parseInt(amount, 10) : amount;
|
const finalAmount = typeof amount === 'string' ? parseInt(amount, 10) : amount;
|
||||||
zap(finalAmount, comment);
|
zap(finalAmount, comment);
|
||||||
@ -374,7 +389,8 @@ export function ZapDialog({ target, children, className }: ZapDialogProps) {
|
|||||||
</div>
|
</div>
|
||||||
</DrawerTrigger>
|
</DrawerTrigger>
|
||||||
<DrawerContent
|
<DrawerContent
|
||||||
className={invoice ? "h-full" : "max-h-[95vh]"}
|
key={invoice ? 'payment' : 'form'}
|
||||||
|
className={invoice ? "h-full max-h-screen" : "max-h-[95vh]"}
|
||||||
data-testid="zap-modal"
|
data-testid="zap-modal"
|
||||||
>
|
>
|
||||||
<DrawerHeader className="text-center relative">
|
<DrawerHeader className="text-center relative">
|
||||||
@ -416,7 +432,7 @@ export function ZapDialog({ target, children, className }: ZapDialogProps) {
|
|||||||
)}
|
)}
|
||||||
</DrawerDescription>
|
</DrawerDescription>
|
||||||
</DrawerHeader>
|
</DrawerHeader>
|
||||||
<div className={invoice ? "flex-1 overflow-y-auto px-2 pb-4" : "overflow-y-auto"}>
|
<div className={invoice ? "flex-1 overflow-y-auto px-2 pb-4 min-h-0" : "overflow-y-auto"}>
|
||||||
<ZapContent {...contentProps} />
|
<ZapContent {...contentProps} />
|
||||||
</div>
|
</div>
|
||||||
</DrawerContent>
|
</DrawerContent>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user