From 5a686a0ffaf0de3f48d0198140f2d0779e6a4fd7 Mon Sep 17 00:00:00 2001 From: Kristian Gjertsen Date: Thu, 12 Nov 2026 19:10:56 +0100 Subject: [PATCH 1/5] Remove manufacturers option from PartsOptions and related components --- frontend/src/api/parts.ts | 5 --- frontend/src/components/FilterComponent.tsx | 38 +------------------ .../src/components/pageSections/Header.tsx | 2 +- frontend/src/hooks/useParts.ts | 2 - 4 files changed, 3 insertions(+), 44 deletions(-) diff --git a/frontend/src/api/parts.ts b/frontend/src/api/parts.ts index 8a91da0..4a1a0c4 100644 --- a/frontend/src/api/parts.ts +++ b/frontend/src/api/parts.ts @@ -15,7 +15,6 @@ type ApiPart = { export type PartsOptions = { search?: string; category?: PcPart["category"]; - manufacturers?: string[]; sortBy?: "NAME" | "PRICE" | "MANUFACTURER" | "CATEGORY"; sortDirection?: "ASC" | "DESC"; first?: number; @@ -35,7 +34,6 @@ export async function getParts( { search = "", category, - manufacturers, sortBy = "NAME", sortDirection = "ASC", first = 20, @@ -52,7 +50,6 @@ export async function getParts( query GetParts( $search: String $category: Category - $manufacturers: [String!] $sortBy: SortField! $sortDirection: SortDirection! $first: Int! @@ -63,7 +60,6 @@ export async function getParts( after: $after search: $search category: $category - manufacturers: $manufacturers sortBy: $sortBy sortDirection: $sortDirection @@ -89,7 +85,6 @@ export async function getParts( variables: { search: search.trim() || null, category: category ?? null, - manufacturers: manufacturers?.length ? manufacturers : null, sortBy, sortDirection, first, diff --git a/frontend/src/components/FilterComponent.tsx b/frontend/src/components/FilterComponent.tsx index 04deefb..8756cf8 100644 --- a/frontend/src/components/FilterComponent.tsx +++ b/frontend/src/components/FilterComponent.tsx @@ -4,7 +4,7 @@ import type { PartsOptions } from "@/api/parts"; import { categories } from "@/types/categories"; import Button from "./buttons/Button"; -// Sort and both filters sit inline only when there is room next to the search field. +// Sort and category controls sit inline when there is room next to the search field. const DESKTOP_FILTER_WIDTH = 1200; type FilterComponentProps = { @@ -52,7 +52,7 @@ export default function FilterComponent({ setSearch(event.target.value)} className="min-w-0 flex-1 rounded-xl bg-surface px-4 py-3 placeholder:text-gray-300" @@ -110,23 +110,6 @@ export default function FilterComponent({ - - -

- Filter +
+

+ Filters

-