Skip to content

Commit

Permalink
feat(#141): show peer dialog in full screen for small viewports
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyckahn committed Dec 3, 2024
1 parent 5806589 commit bf7dc89
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/Shell/PeerListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import ListItemText from '@mui/material/ListItemText'
import Tooltip from '@mui/material/Tooltip'
import Typography from '@mui/material/Typography'
import useTheme from '@mui/material/styles/useTheme'
import { useMediaQuery } from '@mui/material'
import { useContext, useState } from 'react'

import { AudioVolume } from 'components/AudioVolume'
Expand Down Expand Up @@ -69,6 +70,7 @@ export const PeerListItem = ({
const { getUserSettings } = useContext(SettingsContext)
const { userId } = getUserSettings()
const [showPeerDialog, setShowPeerDialog] = useState(false)
const isSmallViewport = useMediaQuery(theme.breakpoints.down('sm'))

const hasPeerConnection = peer.peerId in peerConnectionTypes

Expand Down Expand Up @@ -160,6 +162,8 @@ export const PeerListItem = ({
<Dialog
open={showPeerDialog}
onClose={handleDialogClose}
fullScreen={isSmallViewport}
maxWidth="md"
keepMounted
PaperProps={{
sx: { minHeight: `calc(100% - ${theme.spacing(8)})` },
Expand Down

0 comments on commit bf7dc89

Please sign in to comment.