Import img and add placeholder blur
This commit is contained in:
+25
-1
@@ -2,9 +2,32 @@ import PropTypes from 'prop-types'
|
||||
import Backdrop from '@mui/material/Backdrop'
|
||||
import Image from 'next/image'
|
||||
import useMediaQuery from '@mui/material/useMediaQuery'
|
||||
import pale from '../public/captures/pale.png'
|
||||
import gade from '../public/captures/gade.png'
|
||||
import mobilize from '../public/captures/mobilize.png'
|
||||
import nouvel from '../public/captures/nouvel.png'
|
||||
|
||||
export default function RezoImaj({img, open, setOpen}) {
|
||||
const isSmallDevice = useMediaQuery('(max-width:1160px)')
|
||||
const getSource = source => {
|
||||
if (source === 'pale') {
|
||||
return pale
|
||||
}
|
||||
|
||||
if (source === 'gade') {
|
||||
return gade
|
||||
}
|
||||
|
||||
if (source === 'mobilize') {
|
||||
return mobilize
|
||||
}
|
||||
|
||||
if (source === 'nouvel') {
|
||||
return nouvel
|
||||
}
|
||||
}
|
||||
|
||||
const source = getSource(img)
|
||||
|
||||
const handleClose = () => {
|
||||
setOpen(false)
|
||||
@@ -19,9 +42,10 @@ export default function RezoImaj({img, open, setOpen}) {
|
||||
>
|
||||
<div style={{width: isSmallDevice ? '100%' : '70%', height: isSmallDevice ? '100%' : '70%', position: 'relative'}}>
|
||||
<Image
|
||||
src={`/captures/${img}.png`}
|
||||
src={source}
|
||||
layout='fill'
|
||||
objectFit='contain'
|
||||
placeholder='blur'
|
||||
/>
|
||||
</div>
|
||||
</Backdrop>
|
||||
|
||||
Reference in New Issue
Block a user