Skip to content

Commit

Permalink
feat: removing free/all filter (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiram15 committed Sep 28, 2023
1 parent e9221d0 commit f187fbd
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions packages/catalog-search/src/SearchFilters.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import PropTypes from 'prop-types';
import { breakpoints, MediaQuery } from '@edx/paragon';

import FacetListRefinement from './FacetListRefinement';
import FacetListBase from './FacetListBase';
import CurrentRefinements from './CurrentRefinements';

import MobileFilterMenu from './MobileFilterMenu';

import { SHOW_ALL_NAME, STYLE_VARIANTS } from './data/constants';
import { STYLE_VARIANTS } from './data/constants';
import { sortItemsByLabelAsc } from './data/utils';

import { SearchContext } from './SearchContext';
Expand All @@ -20,18 +19,6 @@ export const FREE_ALL_TITLE = 'Free / All';

const SearchFilters = ({ variant }) => {
const { refinements, searchFacetFilters } = useContext(SearchContext);
const freeAllItems = useMemo(() => [
{
label: 'Free to me',
// flip the 1 to 0 or vice versa using boolean logic
// eslint-disable-next-line no-bitwise
value: refinements[SHOW_ALL_NAME] ^ 1,
},
{
label: 'All courses',
value: refinements[SHOW_ALL_NAME],
},
], [refinements[SHOW_ALL_NAME]]);

const searchFacets = useMemo(
() => {
Expand Down Expand Up @@ -60,17 +47,6 @@ const SearchFilters = ({ variant }) => {
));
return (
<>
{features.ENROLL_WITH_CODES && (
<FacetListBase
attribute={SHOW_ALL_NAME}
facetValueType="bool"
isBold
items={freeAllItems}
key={SHOW_ALL_NAME}
title={FREE_ALL_TITLE}
variant={variant}
/>
)}
{filtersFromRefinements}
{features.LEARNING_TYPE_FACET && (<LearningTypeRadioFacet />)}
</>
Expand Down

0 comments on commit f187fbd

Please sign in to comment.