-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: replace material-ui popover with ui popover in Item menu an…
…d ItemSelector (#1304) In addition to replacing material-ui with @dhis2/ui components, the following refactoring was done: * switch to functional component with hooks * put ItemSearchField into separate file
- Loading branch information
1 parent
abeef90
commit 11db7ca
Showing
10 changed files
with
147 additions
and
148 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
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 React from 'react' | ||
import PropTypes from 'prop-types' | ||
import i18n from '@dhis2/d2-i18n' | ||
import { InputField } from '@dhis2/ui' | ||
|
||
const ItemSearchField = props => ( | ||
<InputField | ||
name="Dashboard item search" | ||
label={i18n.t('Search for items to add to this dashboard')} | ||
type="text" | ||
onChange={props.onChange} | ||
onFocus={props.onFocus} | ||
value={props.value} | ||
dataTest="item-search" | ||
/> | ||
) | ||
|
||
ItemSearchField.propTypes = { | ||
value: PropTypes.string, | ||
onChange: PropTypes.func, | ||
onFocus: PropTypes.func, | ||
} | ||
|
||
export default ItemSearchField |
Oops, something went wrong.