diff --git a/src/containers/CourseFilterControls/ActiveCourseFilters.jsx b/src/containers/CourseFilterControls/ActiveCourseFilters.jsx index e4fad874..a121c749 100644 --- a/src/containers/CourseFilterControls/ActiveCourseFilters.jsx +++ b/src/containers/CourseFilterControls/ActiveCourseFilters.jsx @@ -4,16 +4,17 @@ import { useIntl } from '@edx/frontend-platform/i18n'; import { Button, Chip } from '@openedx/paragon'; import { CloseSmall } from '@openedx/paragon/icons'; +import { reduxHooks } from 'hooks'; import messages from './messages'; import './index.scss'; export const ActiveCourseFilters = ({ filters, - setFilters, handleRemoveFilter, }) => { const { formatMessage } = useIntl(); + const clearFilters = reduxHooks.useClearFilters(); return (
{filters.map(filter => ( @@ -25,7 +26,7 @@ export const ActiveCourseFilters = ({ {formatMessage(messages[filter])} ))} -
@@ -33,10 +34,6 @@ export const ActiveCourseFilters = ({ }; ActiveCourseFilters.propTypes = { filters: PropTypes.arrayOf(PropTypes.string).isRequired, - setFilters: PropTypes.shape({ - remove: PropTypes.func, - clear: PropTypes.func, - }).isRequired, handleRemoveFilter: PropTypes.func.isRequired, }; diff --git a/src/containers/CourseFilterControls/ActiveCourseFilters.test.jsx b/src/containers/CourseFilterControls/ActiveCourseFilters.test.jsx index e920613c..faf74d44 100644 --- a/src/containers/CourseFilterControls/ActiveCourseFilters.test.jsx +++ b/src/containers/CourseFilterControls/ActiveCourseFilters.test.jsx @@ -6,10 +6,6 @@ import ActiveCourseFilters from './ActiveCourseFilters'; describe('ActiveCourseFilters', () => { const props = { filters: Object.values(FilterKeys), - setFilters: { - remove: jest.fn().mockName('setFilters.remove'), - clear: jest.fn().mockName('setFilters.clear'), - }, handleRemoveFilter: jest.fn().mockName('handleRemoveFilter'), }; describe('snapshot', () => { diff --git a/src/containers/CourseFilterControls/CourseFilterControls.jsx b/src/containers/CourseFilterControls/CourseFilterControls.jsx index 46b72a90..4dd98186 100644 --- a/src/containers/CourseFilterControls/CourseFilterControls.jsx +++ b/src/containers/CourseFilterControls/CourseFilterControls.jsx @@ -27,7 +27,6 @@ export const CourseFilterControls = ({ sortBy, setSortBy, filters, - setFilters, }) => { const { formatMessage } = useIntl(); const hasCourses = reduxHooks.useHasCourses(); @@ -41,7 +40,6 @@ export const CourseFilterControls = ({ handleSortChange, } = useCourseFilterControlsData({ filters, - setFilters, setSortBy, }); const { width } = useWindowSize(); @@ -112,10 +110,6 @@ CourseFilterControls.propTypes = { sortBy: PropTypes.string.isRequired, setSortBy: PropTypes.func.isRequired, filters: PropTypes.arrayOf(PropTypes.string).isRequired, - setFilters: PropTypes.shape({ - add: PropTypes.func.isRequired, - remove: PropTypes.func.isRequired, - }).isRequired, }; export default CourseFilterControls; diff --git a/src/containers/CourseFilterControls/CourseFilterControls.test.jsx b/src/containers/CourseFilterControls/CourseFilterControls.test.jsx index 2526bdaa..7daee4e5 100644 --- a/src/containers/CourseFilterControls/CourseFilterControls.test.jsx +++ b/src/containers/CourseFilterControls/CourseFilterControls.test.jsx @@ -23,10 +23,6 @@ describe('CourseFilterControls', () => { sortBy: 'test-sort-by', setSortBy: jest.fn().mockName('setSortBy'), filters: ['test-filter'], - setFilters: { - add: jest.fn().mockName('setFilters.add'), - remove: jest.fn().mockName('setFilters.remove'), - }, }; useCourseFilterControlsData.mockReturnValue({ diff --git a/src/containers/CourseFilterControls/__snapshots__/ActiveCourseFilters.test.jsx.snap b/src/containers/CourseFilterControls/__snapshots__/ActiveCourseFilters.test.jsx.snap index ec20355d..9a9cf832 100644 --- a/src/containers/CourseFilterControls/__snapshots__/ActiveCourseFilters.test.jsx.snap +++ b/src/containers/CourseFilterControls/__snapshots__/ActiveCourseFilters.test.jsx.snap @@ -30,7 +30,7 @@ exports[`ActiveCourseFilters snapshot renders 1`] = ` Upgraded