@@ -42,7 +42,7 @@ const SingleProduct = ({ product }: IProductRootObject) => {
42
42
if ( process . browser ) {
43
43
DESCRIPTION_WITHOUT_HTML = new DOMParser ( ) . parseFromString (
44
44
description ,
45
- 'text/html'
45
+ 'text/html' ,
46
46
) . body . textContent ;
47
47
}
48
48
@@ -58,17 +58,19 @@ const SingleProduct = ({ product }: IProductRootObject) => {
58
58
< div className = "container mx-auto px-4 py-8" >
59
59
< div className = "flex flex-col md:grid md:grid-cols-2 md:gap-8" >
60
60
{ /* Image Container */ }
61
- < div className = "mb-6 md:mb-0" >
62
- < img
63
- id = "product-image"
64
- src = {
65
- image ?. sourceUrl ||
66
- process . env . NEXT_PUBLIC_PLACEHOLDER_LARGE_IMAGE_URL ||
67
- placeholderFallBack
68
- }
69
- alt = { name }
70
- className = "w-full h-auto object-cover transition duration-500 ease-in-out transform md:hover:scale-105"
71
- />
61
+ < div className = "mb-6 md:mb-0 group" >
62
+ < div className = "max-w-xl mx-auto aspect-[3/4] relative overflow-hidden bg-gray-100" >
63
+ < img
64
+ id = "product-image"
65
+ src = {
66
+ image ?. sourceUrl ||
67
+ process . env . NEXT_PUBLIC_PLACEHOLDER_LARGE_IMAGE_URL ||
68
+ placeholderFallBack
69
+ }
70
+ alt = { name }
71
+ className = "w-full h-full object-cover object-center transition duration-300 group-hover:scale-105"
72
+ />
73
+ </ div >
72
74
</ div >
73
75
74
76
{ /* Product Details Container */ }
@@ -126,14 +128,16 @@ const SingleProduct = ({ product }: IProductRootObject) => {
126
128
id = "variant"
127
129
name = "variant"
128
130
className = "w-full px-4 py-2 bg-white border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
129
- onChange = { ( e ) => setSelectedVariation ( Number ( e . target . value ) ) }
131
+ onChange = { ( e ) =>
132
+ setSelectedVariation ( Number ( e . target . value ) )
133
+ }
130
134
>
131
135
{ product . variations . nodes . map (
132
136
( { id, name, databaseId, stockQuantity } ) => (
133
137
< option key = { id } value = { databaseId } >
134
138
{ name . split ( '- ' ) . pop ( ) } - ({ stockQuantity } på lager)
135
139
</ option >
136
- )
140
+ ) ,
137
141
) }
138
142
</ select >
139
143
</ div >
0 commit comments