Skip to content

Commit

Permalink
feat: add language facet to SearchHeader (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstankiewicz authored Mar 25, 2021
1 parent 60f015f commit 74e5fea
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
13 changes: 8 additions & 5 deletions src/course-search/SearchContext.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ const SearchData = ({ children, searchFacetFilters }) => {
}
}, [newQueryString]);

const value = {
refinementsFromQueryParams,
dispatch,
searchFacetFilters,
};
const value = useMemo(
() => ({
refinementsFromQueryParams,
dispatch,
searchFacetFilters,
}),
[refinementsFromQueryParams, dispatch, searchFacetFilters],
);

return (
<SearchContext.Provider value={value}>{children}</SearchContext.Provider>
Expand Down
4 changes: 2 additions & 2 deletions src/course-search/SearchHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ const SearchHeader = () => {
<div className="bg-brand-primary">
<Container size="lg">
<Row className="pt-4 pb-3">
<Col xs={12} md={10} lg={8}>
<Col xs={12} md={8}>
<SearchBox
className="mb-3"
className="mb-4"
defaultRefinement={searchQueryFromQueryParams}
refinementsFromQueryParams={refinementsFromQueryParams}
/>
Expand Down
4 changes: 4 additions & 0 deletions src/course-search/data/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export const SEARCH_FACET_FILTERS = [
attribute: 'availability',
title: 'Availability',
},
{
attribute: 'language',
title: 'Language',
},
];

export const BOOLEAN_FILTERS = [SHOW_ALL_NAME];
Expand Down

0 comments on commit 74e5fea

Please sign in to comment.