Skip to content

Commit 0036465

Browse files
committed
Update SingleProduct.component.tsx
1 parent 742a0bf commit 0036465

File tree

1 file changed

+21
-24
lines changed

1 file changed

+21
-24
lines changed

src/components/Product/SingleProduct.component.tsx

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -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,47 +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">
81+
<div className="px-4 md:ml-8">
82+
<h1 className="text-3xl font-bold text-center md:text-left mb-4">
8383
{name}
84-
</p>
85-
<br />
84+
</h1>
8685
{/* Display sale price when on sale */}
8786
{onSale && (
88-
<div className="flex">
89-
<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">
9089
{product.variations && filteredVariantPrice(price, '')}
9190
{!product.variations && salePrice}
9291
</p>
93-
<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">
9493
{product.variations && filteredVariantPrice(price, 'right')}
9594
{!product.variations && regularPrice}
9695
</p>
9796
</div>
9897
)}
9998
{/* Display regular price when not on sale */}
10099
{!onSale && (
101-
<p className="pt-1 mt-4 text-2xl text-gray-900"> {price}</p>
100+
<p className="text-2xl font-bold mb-4">{price}</p>
102101
)}
103-
<br />
104-
<p className="pt-1 mt-4 text-2xl text-gray-900">
105-
{DESCRIPTION_WITHOUT_HTML}
106-
</p>
102+
<p className="text-lg mb-4">{DESCRIPTION_WITHOUT_HTML}</p>
107103
{Boolean(product.stockQuantity) && (
108-
<p
109-
v-if="data.product.stockQuantity"
110-
className="pt-1 mt-4 mb-4 text-2xl text-gray-900"
111-
>
112-
{product.stockQuantity} på lager
113-
</p>
104+
<div className="mb-4 p-2 bg-green-100 border border-green-400 rounded-lg">
105+
<p className="text-lg text-green-700 font-semibold">
106+
{product.stockQuantity} på lager
107+
</p>
108+
</div>
114109
)}
115110
{product.variations && (
116-
<p className="pt-1 mt-4 text-xl text-gray-900">
117-
<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>
118115
<select
119116
id="variant"
120117
name="variant"
121-
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"
122119
onChange={(e) => {
123120
setSelectedVariation(Number(e.target.value));
124121
}}
@@ -135,9 +132,9 @@ const SingleProduct = ({ product }: IProductRootObject) => {
135132
},
136133
)}
137134
</select>
138-
</p>
135+
</div>
139136
)}
140-
<div className="pt-1 mt-2">
137+
<div className="w-full">
141138
{product.variations && (
142139
<AddToCart
143140
product={product}

0 commit comments

Comments
 (0)