Skip to content

Commit

Permalink
Merge pull request #74 from UjjwalGupta1105/addtocart
Browse files Browse the repository at this point in the history
Notifying Added to Cart
  • Loading branch information
mohitparmar1 authored May 14, 2024
2 parents 19e7de4 + a3af439 commit 974d36c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Components/ProductDisplay.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,22 @@ const ProductDisplay = (props) => {
<div className="flex items-center mb-2 justify-start">
<button
onClick={() => {
if (selectedSize === "") {
toast.error("Please select size");
if (product.size === "") {
toast.error("Please select size", {
autoClose:1500,
});
return;
}
AddToCart(product.id);
toast.success("Added to Cart");
toast.success("Added to Cart ", {
autoClose:1500
});
}}
className="bg-orange-400 w-40 text-white px-4 py-2 rounded"
>
Add to Cart
</button>
<ToastContainer />
<ToastContainer toastStyle={{backgroundColor: "lightgreen" , color: "black", fontWeight:"bold",marginTop:"28px"}}/>
</div>
<div className="flex flex-col my-2">
<p>
Expand Down

0 comments on commit 974d36c

Please sign in to comment.