From bf8890cf00f4ce103e62ce1ee022435751157af5 Mon Sep 17 00:00:00 2001 From: Badri Paudel Date: Thu, 11 Dec 2025 11:47:41 -0600 Subject: [PATCH 1/3] content scrolling fixed --- src/layout/MainLayout.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/layout/MainLayout.tsx b/src/layout/MainLayout.tsx index ec5df56..87ad11b 100644 --- a/src/layout/MainLayout.tsx +++ b/src/layout/MainLayout.tsx @@ -8,9 +8,14 @@ interface MainLayoutProps { export const MainLayout: React.FC = ({ children }) => { return ( -
- {/* */} -
{children}
+
+ + {/* Scrollable content with padding */} +
+ {children} +
+ + {/* Fixed footer on the page*/}
); From d59dd9076c1b4d70948c66aea2ac02e15beef8b0 Mon Sep 17 00:00:00 2001 From: Badri Paudel Date: Mon, 15 Dec 2025 11:27:00 -0600 Subject: [PATCH 2/3] Search functionality implemented --- src/pages/ExplorePage.tsx | 23 ++++++++++++++++++++++- src/services/InventoryService.ts | 7 +++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/pages/ExplorePage.tsx b/src/pages/ExplorePage.tsx index 0cf2d2d..5daf3a7 100644 --- a/src/pages/ExplorePage.tsx +++ b/src/pages/ExplorePage.tsx @@ -24,6 +24,7 @@ export function ExplorePage() { const [position, setPosition] = useState<[number, number] | null>(null); const [menu, setMenu] = useState("map"); const [items, setItems] = useState([]); + const [searchValue, setSearchValue] = useState(""); const navigate = useNavigate(); useEffect(() => { @@ -55,6 +56,22 @@ export function ExplorePage() { } }; + const searhItems = async (query:string) => { + setSearchValue(query); + if(!query || query.trim() === "") { + getItems(); + return; + } + try { + const { data } = await InventoryService.serachAndGetItems(query); + setItems(data); + setSearchValue(""); + } + catch (error) { + alert(`Error searching items with input : ${query}. Error Message is ${error}`); + } + }; + if (!position) return (
@@ -68,7 +85,11 @@ export function ExplorePage() { Explore
- + setSearchValue(e.target.value)} + onSearch={(value) => searhItems(value)} + />
> => { + return service({ + url: "/api/v1/items/search", + params: {searchText: query}, + method: "get", + }); + }, getMyItems: (): Promise> => { return service({ url: "/api/v1/items/my-items", From bf05582c369637eb6f9e85183d6fc4084b789649 Mon Sep 17 00:00:00 2001 From: fkvivid Date: Mon, 15 Dec 2025 19:36:04 -0600 Subject: [PATCH 3/3] minor ui loader empthy update --- src/pages/ExplorePage.tsx | 11 +++---- src/pages/InventoryPage.tsx | 54 +++++++++++++++++++---------------- src/pages/ProductFormPage.tsx | 4 +-- src/pages/ProductShowPage.tsx | 2 +- 4 files changed, 38 insertions(+), 33 deletions(-) diff --git a/src/pages/ExplorePage.tsx b/src/pages/ExplorePage.tsx index 5daf3a7..33d8770 100644 --- a/src/pages/ExplorePage.tsx +++ b/src/pages/ExplorePage.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from "react"; import { MapContainer, TileLayer, Marker, Popup, Tooltip } from "react-leaflet"; import "leaflet/dist/leaflet.css"; -import { Input, Radio, Spin, Image } from "antd"; +import { Input, Radio, Spin, Image, Empty } from "antd"; import { InventoryService } from "../services/InventoryService"; import { useNavigate } from "react-router"; import L from "leaflet"; @@ -65,7 +65,8 @@ export function ExplorePage() { try { const { data } = await InventoryService.serachAndGetItems(query); setItems(data); - setSearchValue(""); + // setSearchValue(""); + setMenu("list") } catch (error) { alert(`Error searching items with input : ${query}. Error Message is ${error}`); @@ -99,7 +100,7 @@ export function ExplorePage() { { label: "List", value: "list" }, ]} onChange={(e) => setMenu(e.target.value)} - defaultValue={menu} + value={menu} optionType="button" buttonStyle="solid" /> @@ -170,8 +171,8 @@ export function ExplorePage() { })} ) : ( -
- {items.map((item, index) => ( +
+ {items.length === 0 ? : items.map((item, index) => (
+
{/* Header */}
@@ -33,31 +33,35 @@ export function InventoryPage() { {/* Scrollable content */}
- {items.map((item, index) => ( -
navigate(`/inventory/${item.id}`)} - > -
- basic image 0 ? item.imageUrls[0] : undefined} - preview={false} - fallback="https://plus.unsplash.com/premium_vector-1731660866636-d6ee4dcd6806?q=80&w=1480&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" - /> + {items.length === 0 ? ( + + ) : ( + items.map((item, index) => ( +
navigate(`/inventory/${item.id}`)} + > +
+ basic image 0 ? item.imageUrls[0] : undefined} + preview={false} + fallback="https://plus.unsplash.com/premium_vector-1731660866636-d6ee4dcd6806?q=80&w=1480&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" + /> +
+
+

{item.name}

+

{item.description}

+
+
{item.quantity}
-
-

{item.name}

-

{item.description}

-
-
{item.quantity}
-
- ))} + )) + )}
-
+
+ )} {/* Cancel claim button */} {myClaim && (