Skip to content

Commit 408ed7f

Browse files
committed
fix(qrcode-modal): improve layout and overflow handling in QR code modal
1 parent 7915625 commit 408ed7f

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

dashboard/src/components/dialogs/qrcode-modal.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,26 @@ const QRCodeModal: FC<QRCodeModalProps> = memo(({ subscribeUrl, onCloseModal })
2020

2121
return (
2222
<Dialog open={isOpen} onOpenChange={onCloseModal}>
23-
<DialogContent className="max-h-[100dvh] max-w-[425px] overflow-y-auto">
23+
<DialogContent className="max-h-[100dvh] max-w-[425px] overflow-y-auto overflow-x-hidden">
2424
<DialogHeader dir={dir}>
2525
<DialogTitle>
2626
<div className="px-2">
2727
<ScanQrCode className="h-8 w-8" />
2828
</div>
2929
</DialogTitle>
3030
</DialogHeader>
31-
<div dir="ltr" className="flex justify-center">
32-
<div className="flex justify-center py-4">
33-
<div className="m-2 flex flex-col items-center justify-center gap-y-4 py-4">
34-
<QRCodeCanvas value={subscribeQrLink} size={300} className="rounded-md bg-white p-2" />
35-
<span>{t('qrcodeDialog.sublink')}</span>
31+
<div dir="ltr" className="flex w-full justify-center overflow-x-hidden">
32+
<div className="flex w-full flex-col items-center justify-center gap-y-4 py-4 px-2">
33+
<div className="flex w-full items-center justify-center">
34+
<div className="flex items-center justify-center overflow-hidden max-w-[calc(100vw-80px)] sm:max-w-[300px]">
35+
<QRCodeCanvas
36+
value={subscribeQrLink}
37+
size={300}
38+
className="rounded-md bg-white p-2 w-full max-w-full h-auto"
39+
/>
40+
</div>
3641
</div>
42+
<span className="text-center">{t('qrcodeDialog.sublink')}</span>
3743
</div>
3844
</div>
3945
</DialogContent>

0 commit comments

Comments
 (0)