Skip to content

Commit ee9b3cb

Browse files
feat: enabled next.js image optimizations
1 parent 7412779 commit ee9b3cb

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/ui/src/components/Image/Image.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,22 @@ import React from 'react';
55

66
import { ImageProps } from './Image.types';
77

8-
const imageLoader: ImageLoader = ({ src, width, quality }) => {
8+
const _imageLoader: ImageLoader = ({ src, width, quality }) => {
99
return `${src}?w=${width}&q=${quality || 99}&fm=webp`;
1010
};
1111

1212
export const Image: React.FC<ImageProps> = ({ src, alt, width, height, fill, ...rest }) => {
1313
if ((width && height) || fill) {
1414
return (
15-
<NextImage src={src} alt={alt} width={width} height={height} fill={fill} loader={imageLoader} {...rest} />
15+
<NextImage
16+
src={src}
17+
alt={alt}
18+
width={width}
19+
height={height}
20+
fill={fill}
21+
//loader={imageLoader}
22+
{...rest}
23+
/>
1624
);
1725
}
1826

0 commit comments

Comments
 (0)