@@ -9,6 +9,8 @@ interface IProps {
image: string
}
export default function FullScreenModal({ modal, setModal, image }: IProps) {
+ const isSvg = image.includes('.svg')
+
return (
-
+ {!isSvg ? (
+
+ ) : (
+

+ )}
)
@@ -170,6 +170,8 @@ export const ImageMessagesList: React.FC = memo(({ device, images
images.map((message) => {
//@ts-ignore
const isZip = message.file && message.file.includes('.zip')
+ //@ts-ignore
+ const isSvg = message.file && message.file.includes('.svg')
return (
{isZip ? (
@@ -203,48 +205,93 @@ export const ImageMessagesList: React.FC = memo(({ device, images
borderRadius: '15px',
}}
>
- {
- setChosenImage(message.file as string)
- setModal(true)
- }}
- onLoadingComplete={() => setLoaded(true)}
- style={{
- position: 'relative',
- zIndex: '2',
- borderRadius: 15,
- width: '100%',
- height: '100%',
- opacity: loaded ? '100%' : '0%',
- userSelect: 'none',
- objectFit: 'contain',
- }}
- width={500}
- height={500}
- src={(message.file as unknown as string) || ''}
- alt={'К сожалению, изображение не загрузилось'}
- />
- setLoaded(true)}
- style={{
- position: 'absolute',
- zIndex: '1',
- borderRadius: 15,
- width: '100%',
- height: '100%',
- opacity: loaded ? '100%' : '0%',
- userSelect: 'none',
- objectFit: 'cover',
- right: 0,
- filter: 'blur(10px) brightness(0.7)',
- }}
- width={10}
- height={10}
- src={(message.file as unknown as string) || ''}
- alt=''
- />
+ {!isSvg ? (
+ <>
+ {
+ setChosenImage(message.file as string)
+ setModal(true)
+ }}
+ onLoadingComplete={() => setLoaded(true)}
+ style={{
+ position: 'relative',
+ zIndex: '2',
+ borderRadius: 15,
+ width: '100%',
+ height: '100%',
+ opacity: loaded ? '100%' : '0%',
+ userSelect: 'none',
+ objectFit: 'contain',
+ }}
+ width={500}
+ height={500}
+ src={(message.file as unknown as string) || ''}
+ alt={'К сожалению, изображение не загрузилось'}
+ />
+ setLoaded(true)}
+ style={{
+ position: 'absolute',
+ zIndex: '1',
+ borderRadius: 15,
+ width: '100%',
+ height: '100%',
+ opacity: loaded ? '100%' : '0%',
+ userSelect: 'none',
+ objectFit: 'cover',
+ right: 0,
+ filter: 'blur(10px) brightness(0.7)',
+ }}
+ width={10}
+ height={10}
+ src={(message.file as unknown as string) || ''}
+ alt=''
+ />
+ >
+ ) : (
+ <>
+
{
+ setChosenImage(message.file as string)
+ setModal(true)
+ }}
+ style={{
+ position: 'relative',
+ zIndex: '2',
+ borderRadius: 15,
+ width: '100%',
+ height: '100%',
+ userSelect: 'none',
+ objectFit: 'contain',
+ }}
+ src={(message.file as unknown as string) || ''}
+ alt='К сожалению, изображение не загрузилось'
+ />
+
+ >
+ )}
+
{!loaded && (