-
Notifications
You must be signed in to change notification settings - Fork 800
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Admin search: update close button behaviour (#38204)
* Admin search: update close button behaviour * Remove projects/plugins/jetpack/_inc/client/components/search/index.jsx from eslint-excludelist.json --------- Co-authored-by: Karen Attfield <[email protected]>
- Loading branch information
1 parent
709dd1d
commit fb3c2bd
Showing
6 changed files
with
91 additions
and
37 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
projects/plugins/jetpack/_inc/client/components/search/clear-btn.jsx
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,15 @@ | ||
import { __ } from '@wordpress/i18n'; | ||
|
||
const SearchClearButton = ( { onClick } ) => { | ||
return ( | ||
<button | ||
className="dops-search__clear-btn" | ||
onClick={ onClick } | ||
aria-label={ __( 'Clear search', 'jetpack' ) } | ||
> | ||
{ __( 'Clear', 'jetpack' ) } | ||
</button> | ||
); | ||
}; | ||
|
||
export default SearchClearButton; |
19 changes: 19 additions & 0 deletions
19
projects/plugins/jetpack/_inc/client/components/search/close-btn.jsx
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,19 @@ | ||
import Gridicon from 'components/gridicon'; | ||
|
||
const SearchCloseButton = ( { instanceId, closeSearch, closeListener } ) => { | ||
return ( | ||
<div | ||
role="button" | ||
className="dops-search__icon-navigation" | ||
onClick={ closeSearch } | ||
tabIndex="0" | ||
onKeyDown={ closeListener } | ||
aria-controls={ 'dops-search-component-' + instanceId } | ||
aria-label="Close Search" | ||
> | ||
<Gridicon icon="cross" className="dops-search__close-icon" /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SearchCloseButton; |
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
4 changes: 4 additions & 0 deletions
4
projects/plugins/jetpack/changelog/fix-jetpack-search-clear-btn
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,4 @@ | ||
Significance: patch | ||
Type: other | ||
|
||
Update search close button behaviour |
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