setting up dark/white mode. fixed some other small things

This commit is contained in:
2025-12-18 21:06:08 -05:00
parent 7f3818f795
commit c6d1bce771
11 changed files with 260 additions and 107 deletions
+8
View File
@@ -1,6 +1,8 @@
"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
/**
* PartsBrowseClient
* -----------------------------------------------------------------------------
@@ -88,6 +90,7 @@ export default function PartsBrowseClient(props: {
}) {
const router = useRouter();
const searchParams = useSearchParams();
const pathname = usePathname();
const effectivePlatform =
props.platform ?? searchParams.get("platform") ?? "AR-15";
@@ -169,6 +172,11 @@ export default function PartsBrowseClient(props: {
inStockOnly,
]);
useEffect(() => {
// Reset scroll position whenever we land on or change parts routes
window.scrollTo({ top: 0, left: 0, behavior: "auto" });
}, [pathname]);
const availableBrands = useMemo(
() =>
Array.from(new Set(parts.map((p) => p.brand)))