File tree Expand file tree Collapse file tree 4 files changed +36
-26
lines changed Expand file tree Collapse file tree 4 files changed +36
-26
lines changed Original file line number Diff line number Diff line change 1
1
import UnderlineLink from "@modules/common/components/underline-link"
2
- import Image from "next/legacy/ image"
2
+ import Image from "next/image"
3
3
4
4
const Hero = ( ) => {
5
5
return (
@@ -16,17 +16,19 @@ const Hero = () => {
16
16
</ div >
17
17
< Image
18
18
src = "/hero.jpg"
19
- layout = "fill"
20
19
loading = "eager"
21
20
priority = { true }
22
21
quality = { 90 }
23
- objectFit = "cover"
24
22
alt = "Photo by @thevoncomplex https://unsplash.com/@thevoncomplex"
25
23
className = "absolute inset-0"
26
24
draggable = "false"
27
- />
25
+ fill
26
+ sizes = "100vw"
27
+ style = { {
28
+ objectFit : "cover"
29
+ } } />
28
30
</ div >
29
- )
31
+ ) ;
30
32
}
31
33
32
34
export default Hero
Original file line number Diff line number Diff line change 1
1
import UnderlineLink from "@modules/common/components/underline-link"
2
- import Image from "next/legacy/ image"
2
+ import Image from "next/image"
3
3
4
4
const FooterCTA = ( ) => {
5
5
return (
@@ -16,14 +16,16 @@ const FooterCTA = () => {
16
16
< Image
17
17
src = "/cta_three.jpg"
18
18
alt = ""
19
- layout = "fill"
20
- objectFit = "cover"
21
19
className = "absolute inset-0"
22
- />
20
+ fill
21
+ sizes = "100vw"
22
+ style = { {
23
+ objectFit : "cover"
24
+ } } />
23
25
</ div >
24
26
</ div >
25
27
</ div >
26
- )
28
+ ) ;
27
29
}
28
30
29
31
export default FooterCTA
Original file line number Diff line number Diff line change 1
1
import { Image as MedusaImage } from "@medusajs/medusa"
2
- import Image from "next/legacy/ image"
2
+ import Image from "next/image"
3
3
import { useRef } from "react"
4
4
5
5
type ImageGalleryProps = {
@@ -35,13 +35,15 @@ const ImageGallery = ({ images }: ImageGalleryProps) => {
35
35
< span className = "sr-only" > Go to image { index + 1 } </ span >
36
36
< Image
37
37
src = { image . url }
38
- layout = "fill"
39
- objectFit = "cover"
40
38
className = "absolute inset-0"
41
39
alt = "Thumbnail"
42
- />
40
+ fill
41
+ sizes = "100vw"
42
+ style = { {
43
+ objectFit : "cover"
44
+ } } />
43
45
</ button >
44
- )
46
+ ) ;
45
47
} ) }
46
48
</ div >
47
49
< div className = "flex flex-col flex-1 small:mx-16 gap-y-4" >
@@ -55,18 +57,20 @@ const ImageGallery = ({ images }: ImageGalleryProps) => {
55
57
>
56
58
< Image
57
59
src = { image . url }
58
- layout = "fill"
59
- objectFit = "cover"
60
60
priority = { index <= 2 ? true : false }
61
61
className = "absolute inset-0"
62
62
alt = { `Product image ${ index + 1 } ` }
63
- />
63
+ fill
64
+ sizes = "100vw"
65
+ style = { {
66
+ objectFit : "cover"
67
+ } } />
64
68
</ div >
65
- )
69
+ ) ;
66
70
} ) }
67
71
</ div >
68
72
</ div >
69
- )
73
+ ) ;
70
74
}
71
75
72
76
export default ImageGallery
Original file line number Diff line number Diff line change 1
1
import { Image as MedusaImage } from "@medusajs/medusa"
2
2
import PlaceholderImage from "@modules/common/icons/placeholder-image"
3
3
import clsx from "clsx"
4
- import Image from "next/legacy/ image"
4
+ import Image from "next/image"
5
5
import React from "react"
6
6
7
7
type ThumbnailProps = {
@@ -39,17 +39,19 @@ const ImageOrPlaceholder = ({
39
39
< Image
40
40
src = { image }
41
41
alt = "Thumbnail"
42
- layout = "fill"
43
- objectFit = "cover"
44
- objectPosition = "center"
45
42
className = "absolute inset-0"
46
43
draggable = { false }
47
- />
44
+ fill
45
+ sizes = "100vw"
46
+ style = { {
47
+ objectFit : "cover" ,
48
+ objectPosition : "center"
49
+ } } />
48
50
) : (
49
51
< div className = "w-full h-full absolute inset-0 bg-gray-100 flex items-center justify-center" >
50
52
< PlaceholderImage size = { size === "small" ? 16 : 24 } />
51
53
</ div >
52
- )
54
+ ) ;
53
55
}
54
56
55
57
export default Thumbnail
You can’t perform that action at this time.
0 commit comments