-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow filtering library by publish status
- Loading branch information
1 parent
a94df2f
commit a1b1a47
Showing
5 changed files
with
95 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import React from 'react'; | ||
import { FormattedMessage } from '@edx/frontend-platform/i18n'; | ||
Check failure on line 2 in src/search-manager/FilterByPublished.tsx GitHub Actions / tests (18)
|
||
import { | ||
Badge, | ||
Form, | ||
Menu, | ||
MenuItem, | ||
} from '@openedx/paragon'; | ||
import { FilterList } from '@openedx/paragon/icons'; | ||
import SearchFilterWidget from './SearchFilterWidget'; | ||
import messages from './messages'; | ||
Check failure on line 11 in src/search-manager/FilterByPublished.tsx GitHub Actions / tests (18)
|
||
// import { useSearchContext } from './SearchManager'; | ||
|
||
/** | ||
* A button with a dropdown that allows filtering the current search by publish status | ||
*/ | ||
const FilterByPublished: React.FC<Record<never, never>> = () => { | ||
// const { | ||
// publishedFilter, | ||
// setPublishedFilter, | ||
// } = useSearchContext(); | ||
|
||
const clearFilters = React.useCallback(() => { | ||
// setPublishedFilter(undefined); | ||
}, []); | ||
|
||
return ( | ||
<SearchFilterWidget | ||
appliedFilters={[]} | ||
label="Publish Status" | ||
clearFilter={clearFilters} | ||
icon={FilterList} | ||
> | ||
<Form.Group className="mb-0"> | ||
<Form.CheckboxSet | ||
name="block-type-filter" | ||
value={[]} | ||
> | ||
<Menu className="block-type-refinement-menu" style={{ boxShadow: 'none' }}> | ||
<MenuItem | ||
as={Form.Checkbox} | ||
value={1} | ||
onChange={() => {}} | ||
> | ||
<div> | ||
Published | ||
<Badge variant="light" pill>15</Badge> | ||
</div> | ||
</MenuItem> | ||
<MenuItem | ||
as={Form.Checkbox} | ||
value={2} | ||
onChange={() => {}} | ||
> | ||
<div> | ||
Modified since publish | ||
<Badge variant="light" pill>5</Badge> | ||
</div> | ||
</MenuItem> | ||
<MenuItem | ||
as={Form.Checkbox} | ||
value={3} | ||
onChange={() => {}} | ||
> | ||
<div> | ||
Never published | ||
<Badge variant="light" pill>2</Badge> | ||
</div> | ||
</MenuItem> | ||
</Menu> | ||
</Form.CheckboxSet> | ||
</Form.Group> | ||
</SearchFilterWidget> | ||
); | ||
}; | ||
|
||
export default FilterByPublished; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters