From a8417a3697ee202c830d21b699a1d696213a9318 Mon Sep 17 00:00:00 2001 From: Mann Patel <130435633+MannPatel0@users.noreply.github.com> Date: Fri, 18 Apr 2025 10:37:19 -0600 Subject: [PATCH] updating frontend code --- frontend/src/App.jsx | 5 + frontend/src/components/Navbar.jsx | 8 +- frontend/src/components/ProductForm.jsx | 123 ++-- frontend/src/components/UserDropdown.jsx | 42 +- frontend/src/pages/Favorites.jsx | 191 +++-- frontend/src/pages/Home.jsx | 660 ++++++++++-------- frontend/src/pages/ProductDetail.jsx | 91 ++- frontend/src/pages/SearchPage.jsx | 57 +- mysql-code/Init-Data.sql | 1 - .../__pycache__/app.cpython-313.pyc | Bin 0 -> 5724 bytes 10 files changed, 666 insertions(+), 512 deletions(-) create mode 100644 recommondation-engine/__pycache__/app.cpython-313.pyc diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index a3ec64f..c266822 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -52,6 +52,11 @@ function App() { return () => window.removeEventListener("resize", handleResize); }, []); + +useEffect(() => { + sendSessionDataToServer(); +}, []); + // Send verification code const sendVerificationCode = async (userData) => { try { diff --git a/frontend/src/components/Navbar.jsx b/frontend/src/components/Navbar.jsx index 711ad26..95d41c6 100644 --- a/frontend/src/components/Navbar.jsx +++ b/frontend/src/components/Navbar.jsx @@ -35,7 +35,7 @@ const Navbar = ({ onLogout, userName }) => { alt="Campus Plug" className="h-8 px-2" /> - + Campus Plug @@ -48,7 +48,7 @@ const Navbar = ({ onLogout, userName }) => { @@ -57,7 +57,7 @@ const Navbar = ({ onLogout, userName }) => { @@ -70,7 +70,7 @@ const Navbar = ({ onLogout, userName }) => { {/* Favorites Button */} diff --git a/frontend/src/components/ProductForm.jsx b/frontend/src/components/ProductForm.jsx index f594d24..9885d07 100644 --- a/frontend/src/components/ProductForm.jsx +++ b/frontend/src/components/ProductForm.jsx @@ -1,4 +1,5 @@ import React, { useState } from "react"; +import { X, ChevronLeft, Plus, Trash2 } from "lucide-react"; const ProductForm = ({ editingProduct, @@ -50,63 +51,64 @@ const ProductForm = ({ }; return ( -
+
{/* Back Button */} -

+

{editingProduct?.id ? "Edit Your Product" : "List a New Product"}

-
+
{/* Product Name */}
-
{/* Price */}
-
- {/* Categories - Dropdown with Add button */} + {/* Categories */}
-