Skip to content

Commit

Permalink
fix: vertical scrolling after opening the Mobile paring modal (#1295)
Browse files Browse the repository at this point in the history
* chore: fix vertical scrolling after opening the Mobile paring modal

* cheking CLA

* alternative fix: make Dialog a controlled component

Co-authored-by: katspaugh <381895+katspaugh@users.noreply.github.com>
  • Loading branch information
metadiver and katspaugh authored Dec 6, 2022
1 parent 68cd5b8 commit edce31f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/services/pairing/QRModal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from 'react'
import { Dialog, DialogContent, DialogTitle, IconButton } from '@mui/material'
import { createRoot } from 'react-dom/client'
import CloseIcon from '@mui/icons-material/Close'

import PairingQRCode from '@/components/common/PairingDetails/PairingQRCode'
import PairingDescription from '@/components/common/PairingDetails/PairingDescription'
import { StoreHydrator } from '@/store'
Expand Down Expand Up @@ -49,15 +49,18 @@ const close = () => {
}

const Modal = ({ uri, cb }: { uri: string; cb: () => void }) => {
const [open, setOpen] = useState(true)

const handleClose = () => {
cb()
setOpen(false)
close()
}

return (
<StoreHydrator>
<AppProviders>
<Dialog open onClose={handleClose} disablePortal className={css.modal}>
<Dialog open={open} onClose={handleClose} disablePortal className={css.modal}>
<DialogTitle sx={{ m: 0, p: 2, display: 'flex', justifyContent: 'space-between' }}>
{PAIRING_MODULE_LABEL}
<IconButton
Expand Down

0 comments on commit edce31f

Please sign in to comment.