feat: add blur img

:%s
This commit is contained in:
lytrankieio123
2021-09-09 16:48:54 +07:00
parent 985f8861c8
commit 1a4392eacc
2 changed files with 9 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
import React from 'react'
import s from './ImgWithLink.module.scss'
import Image from 'next/image'
import { BLUR_DATA_IMG } from 'src/utils/constanst.utils'
export interface ImgWithLinkProps {
src: string,
@@ -10,7 +11,12 @@ export interface ImgWithLinkProps {
const ImgWithLink = ({ src, alt }: ImgWithLinkProps) => {
return (
<div className={s.imgWithLink}>
<Image src={src} alt={alt} layout="fill" className={s.imgWithLink} />
<Image src={src} alt={alt}
layout="fill"
className={s.imgWithLink}
placeholder="blur"
blurDataURL={BLUR_DATA_IMG}
/>
</div>
)
}