@@ -57,7 +57,7 @@ const SingleProduct = ({ product }: IProductRootObject) => {
57
57
< LoadingSpinner />
58
58
</ div >
59
59
) : (
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" >
61
61
< 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" >
62
62
{ image && (
63
63
< img
@@ -78,45 +78,44 @@ const SingleProduct = ({ product }: IProductRootObject) => {
78
78
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"
79
79
/>
80
80
) }
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 >
84
85
{ /* Display sale price when on sale */ }
85
86
{ 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 " >
88
89
{ product . variations && filteredVariantPrice ( price , '' ) }
89
90
{ ! product . variations && salePrice }
90
91
</ 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 " >
92
93
{ product . variations && filteredVariantPrice ( price , 'right' ) }
93
94
{ ! product . variations && regularPrice }
94
95
</ p >
95
96
</ div >
96
97
) }
97
98
{ /* Display regular price when not on sale */ }
98
99
{ ! 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 >
100
101
) }
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 >
105
103
{ 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 >
112
109
) }
113
110
{ 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 >
116
115
< select
117
116
id = "variant"
118
117
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 "
120
119
onChange = { ( e ) => {
121
120
setSelectedVariation ( Number ( e . target . value ) ) ;
122
121
} }
@@ -133,20 +132,17 @@ const SingleProduct = ({ product }: IProductRootObject) => {
133
132
} ,
134
133
) }
135
134
</ select >
136
- </ p >
135
+ </ div >
137
136
) }
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" >
143
138
{ product . variations && (
144
139
< AddToCart
145
140
product = { product }
146
141
variationId = { selectedVariation }
142
+ fullWidth = { true }
147
143
/>
148
144
) }
149
- { ! product . variations && < AddToCart product = { product } /> }
145
+ { ! product . variations && < AddToCart product = { product } fullWidth = { true } /> }
150
146
</ div >
151
147
</ div >
152
148
</ div >
0 commit comments