fixed logo, fixed product details page image and api

This commit is contained in:
2025-12-09 06:11:50 -05:00
parent 6b0e0334b0
commit 7c2206ffc3
5 changed files with 57 additions and 38 deletions
+2 -5
View File
@@ -6,6 +6,7 @@ import { useParams, useRouter } from "next/navigation";
import { CATEGORIES } from "@/data/gunbuilderParts";
import type { CategoryId, Part } from "@/types/gunbuilder";
type ViewMode = "card" | "list";
type GunbuilderProductFromApi = {
@@ -134,11 +135,6 @@ export default function CategoryPage() {
}
}, [build]);
useEffect(() => {
// whenever the category or filters change, jump back to page 1
setCurrentPage(1);
}, [categoryId, brandFilter, sortBy, searchQuery]);
// handler to toggle Add / Remove for this category
const handleTogglePart = (categoryId: CategoryId, partId: string) => {
const isSelected = build[categoryId] === partId;
@@ -293,6 +289,7 @@ export default function CategoryPage() {
return { start, end };
}, [filteredParts.length, currentPage, paginatedParts.length, PAGE_SIZE]);
if (!category) {
return (
<main className="min-h-screen bg-black text-zinc-50">