@@ -47,10 +47,10 @@ interface IDisplayProductsProps {
4747 */
4848
4949const DisplayProducts = ( { products } : IDisplayProductsProps ) => (
50- < section className = "container mx-auto bg-white" >
50+ < section className = "container mx-auto bg-white py-12 " >
5151 < div
5252 id = "product-container"
53- className = "flex flex-wrap items-center mb-[120px] md:mb-0 "
53+ className = "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8 "
5454 >
5555 { products ? (
5656 products . map (
@@ -77,67 +77,61 @@ const DisplayProducts = ({ products }: IDisplayProductsProps) => (
7777 }
7878
7979 return (
80- < div
81- key = { uuidv4 ( ) }
82- className = "flex flex-col p-6 md:w-1/2 xl:w-1/4"
83- >
80+ < div key = { uuidv4 ( ) } className = "group" >
8481 < Link
8582 href = { `/produkt/${ encodeURIComponent (
8683 slug ,
8784 ) } ?id=${ encodeURIComponent ( databaseId ) } `}
8885 >
89- < span >
86+ < div className = "aspect-[3/4] relative overflow-hidden bg-gray-100" >
9087 { image ? (
9188 < img
9289 id = "product-image"
93- className = "transition duration-500 ease-in-out transform cursor-pointer hover:grow hover:shadow-lg hover:scale-105"
90+ className = "w-full h-full object-cover object-center transition duration-300 group- hover:scale-105"
9491 alt = { name }
9592 src = { image . sourceUrl }
9693 />
9794 ) : (
9895 < img
9996 id = "product-image"
100- className = "transition duration-500 ease-in-out transform cursor-pointer hover:grow hover:shadow-lg hover:scale-105"
97+ className = "w-full h-full object-cover object-center transition duration-300 group- hover:scale-105"
10198 alt = { name }
102- src = {
103- process . env . NEXT_PUBLIC_PLACEHOLDER_SMALL_IMAGE_URL
104- }
99+ src = { process . env . NEXT_PUBLIC_PLACEHOLDER_SMALL_IMAGE_URL }
105100 />
106101 ) }
107- </ span >
102+ </ div >
108103 </ Link >
109104 < Link
110105 href = { `/produkt/${ encodeURIComponent (
111106 slug ,
112107 ) } ?id=${ encodeURIComponent ( databaseId ) } `}
113108 >
114109 < span >
115- < div className = "flex justify-center pt-3 " >
116- < p className = "font-bold text-center cursor-pointer text-2xl " >
110+ < div className = "mt-4 " >
111+ < p className = "text-base text-center cursor-pointer hover: text-gray-600 transition-colors " >
117112 { name }
118113 </ p >
119114 </ div >
120115 </ span >
121116 </ Link >
122- { /* Display sale price when on sale */ }
123- { onSale && (
124- < div className = "flex justify-center" >
125- < div className = "pt-1 text-gray-900 text-xl" >
126- { variations && filteredVariantPrice ( price , '' ) }
127- { ! variations && salePrice }
117+ < div className = "mt-2 text-center" >
118+ { onSale ? (
119+ < div className = "flex justify-center items-center space-x-2" >
120+ < span className = "text-red-600" >
121+ { variations && filteredVariantPrice ( price , '' ) }
122+ { ! variations && salePrice }
123+ </ span >
124+ < span className = "text-gray-500 text-sm line-through" >
125+ { variations && filteredVariantPrice ( price , 'right' ) }
126+ { ! variations && regularPrice }
127+ </ span >
128128 </ div >
129- < div className = "pt-1 ml-2 text-gray-500 line-through text-lg" >
130- { variations && filteredVariantPrice ( price , 'right' ) }
131- { ! variations && regularPrice }
132- </ div >
133- </ div >
134- ) }
135- { /* Display regular price when not on sale */ }
136- { ! onSale && (
137- < p className = "pt-1 text-center text-gray-900 text-xl" >
138- { price }
139- </ p >
140- ) }
129+ ) : (
130+ < span className = "text-gray-900" >
131+ { price }
132+ </ span >
133+ ) }
134+ </ div >
141135 </ div >
142136 ) ;
143137 } ,
0 commit comments