diff --git a/web/app/adopt/page.js b/web/app/adopt/page.js index f32eab3a..7cc23723 100644 --- a/web/app/adopt/page.js +++ b/web/app/adopt/page.js @@ -131,7 +131,7 @@ export default function AdoptPage() { setSearch(e.target.value)} /> diff --git a/web/app/products/page.js b/web/app/products/page.js index 48959a2a..155ba778 100644 --- a/web/app/products/page.js +++ b/web/app/products/page.js @@ -56,7 +56,7 @@ export default function ProductsPage() { setSearch(e.target.value)} /> diff --git a/web/components/ProductProfile.js b/web/components/ProductProfile.js index efd2ece7..98cb356c 100644 --- a/web/components/ProductProfile.js +++ b/web/components/ProductProfile.js @@ -26,6 +26,7 @@ export default function ProductProfile({ prodId, prodName, categoryName, prodDes await addItem(prodId, quantity); setFeedback({ type: "success", message: `${quantity} × ${prodName} added to cart!` }); setQuantity(1); + setTimeout(() => setFeedback(null), 1000); } catch (err) { setFeedback({ type: "error", message: err.message ?? "Failed to add to cart." }); } finally { @@ -90,20 +91,20 @@ export default function ProductProfile({ prodId, prodName, categoryName, prodDes -
- {feedback && ( -

- {feedback.message} -

- )} -
+ {feedback?.type === "error" && ( +

+ {feedback.message} +

+ )} )} diff --git a/web/public/bootstrap/cart-plus-fill.svg b/web/public/bootstrap/cart-plus-fill.svg new file mode 100644 index 00000000..59e46e48 --- /dev/null +++ b/web/public/bootstrap/cart-plus-fill.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file