Comments, appointments adjustments, fixed some issues

This commit is contained in:
augmentedpotato
2026-04-20 19:19:30 -06:00
parent 1523aef51e
commit 6d593726a5
34 changed files with 402 additions and 104 deletions

View File

@@ -6,8 +6,10 @@ import { useRouter } from "next/navigation";
import { useAuth } from "@/context/AuthContext";
import { useCart } from "@/context/CartContext";
//Shared CSS class for the quantity plus and minus buttons
const qtyBtnCls = "w-7 h-7 border border-[#ddd] rounded-md bg-white text-base cursor-pointer flex items-center justify-center transition-colors hover:border-[#e68672] disabled:opacity-50";
//Card shown in the products grid, includes quantity selector and add to cart button
export default function ProductCard({ prodId, prodName, categoryName, prodPrice, imageUrl }) {
const { user } = useAuth();
const { addItem, selectedStoreId } = useCart();
@@ -16,6 +18,7 @@ export default function ProductCard({ prodId, prodName, categoryName, prodPrice,
const [adding, setAdding] = useState(false);
const [feedback, setFeedback] = useState(null);
//Adds the selected quantity to the cart, redirects to login if not logged in
async function handleAddToCart(e) {
e.preventDefault();
if (!user) { router.push("/login"); return; }