Skip to content

Commit

Permalink
feat(file-sharing): [closes #308] scale shared images to fit
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyckahn committed Jun 5, 2024
1 parent 73218f4 commit a8dff45
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Message/InlineMedia.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useContext, useEffect, useRef, useState } from 'react'
import { TorrentFile } from 'webtorrent'
import Box from '@mui/material/Box'
import CircularProgress from '@mui/material/CircularProgress'
import Typography from '@mui/material/Typography'

Expand Down Expand Up @@ -37,13 +38,13 @@ export const InlineFile = ({ file }: InlineFileProps) => {
}, [file, containerRef, shellContext.roomId])

return (
<div ref={containerRef}>
<Box ref={containerRef} sx={{ '& img': { maxWidth: '100%' } }}>
{didRenderingMediaFail && (
<Typography sx={{ fontStyle: 'italic' }}>
Media failed to render
</Typography>
)}
</div>
</Box>
)
}

Expand Down

0 comments on commit a8dff45

Please sign in to comment.