-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d306d5
commit d61ce14
Showing
6 changed files
with
43 additions
and
2 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
24 changes: 24 additions & 0 deletions
24
src/components/sectionList/filters/filterSelectors/FormTypeFilter.tsx
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,24 @@ | ||
import i18n from '@dhis2/d2-i18n' | ||
import React from 'react' | ||
import { useSectionListFilter } from '../../../../lib' | ||
import { createFilterDataQuery } from './createFilterDataQuery' | ||
import { ModelFilterSelect } from './ModelFilter' | ||
|
||
const query = createFilterDataQuery('formTypes') | ||
|
||
export const FormTypeFilter = () => { | ||
const [filter, setFilter] = useSectionListFilter('formType') | ||
|
||
const selected = filter?.[0] | ||
|
||
return ( | ||
<ModelFilterSelect | ||
placeholder={i18n.t('Form Type')} | ||
query={query} | ||
selected={selected} | ||
onChange={({ selected }) => | ||
setFilter(selected ? [selected] : undefined) | ||
} | ||
/> | ||
) | ||
} |
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