diff --git a/app/search/[collection]/page.tsx b/app/search/[collection]/page.tsx index cc8615ac5..4aa9068a5 100644 --- a/app/search/[collection]/page.tsx +++ b/app/search/[collection]/page.tsx @@ -6,7 +6,6 @@ import Breadcrumb from 'components/breadcrumb'; import BreadcrumbHome from 'components/breadcrumb/breadcrumb-home'; import FAQ from 'components/faq'; import YMMFilters, { YMMFiltersPlaceholder } from 'components/filters'; -import Grid from 'components/grid'; import Manufacturers from 'components/home-page/manufacturers'; import ProductsList from 'components/layout/products-list'; import { getProductsInCollection } from 'components/layout/products-list/actions'; @@ -61,19 +60,18 @@ async function CategoryPage({ } /> - - {products.length === 0 ? ( -

{`No products found in this collection`}

- ) : ( - - )} -
+ + {products.length === 0 ? ( +

{`No products found in this collection`}

+ ) : ( + + )} ); } diff --git a/components/filters/filters-list.tsx b/components/filters/filters-list.tsx index 6c0661699..4105529b6 100644 --- a/components/filters/filters-list.tsx +++ b/components/filters/filters-list.tsx @@ -43,10 +43,11 @@ const FiltersList = ({ years, makes, models, menu, autoFocusField }: FiltersList null ); const [model, setModel] = useState( - (make && models.find((model) => model.id === searchParams.get(MODEL_FILTER_ID))) || null + models.find((model) => model.id === searchParams.get(MODEL_FILTER_ID)) || null ); + const [year, setYear] = useState( - (model && years.find((y) => y.id === searchParams.get(YEAR_FILTER_ID))) || null + years.find((y) => y.id === searchParams.get(YEAR_FILTER_ID)) || null ); const modelOptions = make ? models.filter((m) => get(m, 'make') === make.id) : models; @@ -63,9 +64,13 @@ const FiltersList = ({ years, makes, models, menu, autoFocusField }: FiltersList ); if (_make) { - setMake(_make); - setModel(null); - setYear(null); + setMake((currentMake) => { + if (currentMake?.id !== _make.id) { + setModel(null); + setYear(null); + } + return _make; + }); } } }, [makeIdFromSearchParams, makes, params.collection, partType]); diff --git a/components/hero.tsx b/components/hero.tsx index a5099371c..f43cd95e4 100644 --- a/components/hero.tsx +++ b/components/hero.tsx @@ -38,48 +38,48 @@ const Hero = async () => { -
-
- {/* Decorative image and overlay */} -