@@ -57,7 +57,7 @@ const SingleProduct = ({ product }: IProductRootObject) => {
5757 < LoadingSpinner />
5858 </ div >
5959 ) : (
60- < div className = "container flex flex-wrap items-center pt-4 pb-12 mx-auto " >
60+ < div className = "container flex flex-wrap items-center pt-4 pb-12 mx-auto" >
6161 < div className = "grid grid-cols-1 gap-4 md:mt-16 lg:grid-cols-2 xl:grid-cols-2 md:grid-cols-2 sm:grid-cols-2" >
6262 { image && (
6363 < img
@@ -78,45 +78,44 @@ const SingleProduct = ({ product }: IProductRootObject) => {
7878 className = "h-auto p-8 transition duration-500 ease-in-out transform xl:p-2 md:p-2 lg:p-2 md:hover:grow md:hover:shadow-lg md:hover:scale-105"
7979 />
8080 ) }
81- < div className = "ml-8" >
82- < p className = "text-3xl font-bold text-center md:text-left" > { name } </ p >
83- < br />
81+ < div className = "px-4 md:ml-8" >
82+ < h1 className = "text-3xl font-bold text-center md:text-left mb-4" >
83+ { name }
84+ </ h1 >
8485 { /* Display sale price when on sale */ }
8586 { onSale && (
86- < div className = "flex" >
87- < p className = "pt-1 mt-4 text-3xl text-gray-900 " >
87+ < div className = "flex flex-col md:flex-row items-center md:items-start mb-4 " >
88+ < p className = "text-3xl font-bold text-red-600 " >
8889 { product . variations && filteredVariantPrice ( price , '' ) }
8990 { ! product . variations && salePrice }
9091 </ p >
91- < p className = "pt-1 pl-8 mt-4 text-2xl text-gray-900 line-through" >
92+ < p className = "text-xl text-gray-500 line-through md:ml-4 " >
9293 { product . variations && filteredVariantPrice ( price , 'right' ) }
9394 { ! product . variations && regularPrice }
9495 </ p >
9596 </ div >
9697 ) }
9798 { /* Display regular price when not on sale */ }
9899 { ! onSale && (
99- < p className = "pt-1 mt-4 text-2xl text-gray-900" > { price } </ p >
100+ < p className = "text-2xl font-bold mb-4" > { price } </ p >
100101 ) }
101- < br />
102- < p className = "pt-1 mt-4 text-2xl text-gray-900" >
103- { DESCRIPTION_WITHOUT_HTML }
104- </ p >
102+ < p className = "text-lg mb-4 text-center md:text-left" > { DESCRIPTION_WITHOUT_HTML } </ p >
105103 { Boolean ( product . stockQuantity ) && (
106- < p
107- v-if = "data.product.stockQuantity"
108- className = "pt-1 mt-4 mb-4 text-2xl text-gray-900"
109- >
110- { product . stockQuantity } på lager
111- </ p >
104+ < div className = "mb-4 p-2 bg-green-100 border border-green-400 rounded-lg mx-auto md:mx-0 max-w-[14.375rem]" >
105+ < p className = "text-lg text-green-700 font-semibold text-center md:text-left" >
106+ { product . stockQuantity } på lager
107+ </ p >
108+ </ div >
112109 ) }
113110 { product . variations && (
114- < p className = "pt-1 mt-4 text-xl text-gray-900" >
115- < span className = "py-2" > Varianter</ span >
111+ < div className = "mb-4" >
112+ < label htmlFor = "variant" className = "block text-lg font-medium mb-2" >
113+ Varianter
114+ </ label >
116115 < select
117116 id = "variant"
118117 name = "variant"
119- className = "block w-80 px-6 py-2 bg-white border border-gray-500 rounded-lg focus:outline-none focus:shadow-outline "
118+ className = "block w-full px-4 py-2 bg-white border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 "
120119 onChange = { ( e ) => {
121120 setSelectedVariation ( Number ( e . target . value ) ) ;
122121 } }
@@ -133,20 +132,17 @@ const SingleProduct = ({ product }: IProductRootObject) => {
133132 } ,
134133 ) }
135134 </ select >
136- </ p >
135+ </ div >
137136 ) }
138- < div className = "pt-1 mt-2" >
139- {
140- // Display default AddToCart button if we do not have variations.
141- // If we do, send the variationId to AddToCart button
142- }
137+ < div className = "w-full p-4 md:p-0" >
143138 { product . variations && (
144139 < AddToCart
145140 product = { product }
146141 variationId = { selectedVariation }
142+ fullWidth = { true }
147143 />
148144 ) }
149- { ! product . variations && < AddToCart product = { product } /> }
145+ { ! product . variations && < AddToCart product = { product } fullWidth = { true } /> }
150146 </ div >
151147 </ div >
152148 </ div >
0 commit comments