Skip to content

Commit

Permalink
refactor: add changes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyrylo Hudym-Levkovych authored and Kyrylo Hudym-Levkovych committed Nov 21, 2023
1 parent a72d149 commit 56ba018
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
6 changes: 2 additions & 4 deletions src/SearchField/SearchFieldAdvanced.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import classNames from 'classnames';
import { Search, Close } from '../../icons';
import newId from '../utils/newId';

import Icon from '../Icon';

export const SearchFieldContext = createContext();

const BUTTON_LOCATION_VARIANTS = [
Expand Down Expand Up @@ -189,8 +187,8 @@ SearchFieldAdvanced.defaultProps = {
clearButton: 'clear search',
},
icons: {
clear: <Icon src={Close} />,
submit: <Icon src={Search} />,
clear: Close,
submit: Search,
},
onBlur: () => {},
onChange: () => {},
Expand Down
2 changes: 1 addition & 1 deletion src/SearchField/SearchFieldClearButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function SearchFieldClearButton(props) {
return (
<IconButton
type="reset"
src={icons.clear.props.src}
src={icons.clear}
iconAs={Icon}
alt={screenReaderText.clearButton}
disabled={disabled}
Expand Down
2 changes: 1 addition & 1 deletion src/SearchField/SearchFieldSubmitButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function SearchFieldSubmitButton(props) {
) : (
<IconButton
type="submit"
src={icons.submit.props.src}
src={icons.submit}
iconAs={Icon}
alt={screenReaderText.submitButton}
disabled={disabled}
Expand Down
6 changes: 2 additions & 4 deletions src/SearchField/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import SearchFieldInput from './SearchFieldInput';
import SearchFieldClearButton from './SearchFieldClearButton';
import SearchFieldSubmitButton from './SearchFieldSubmitButton';

import Icon from '../Icon';

export const SEARCH_FIELD_SCREEN_READER_TEXT_LABEL = 'search';
export const SEARCH_FIELD_SCREEN_READER_TEXT_SUBMIT_BUTTON = 'submit search';
export const SEARCH_FIELD_SCREEN_READER_TEXT_CLEAR_BUTTON = 'clear search';
Expand Down Expand Up @@ -170,8 +168,8 @@ SearchField.defaultProps = {
clearButton: SEARCH_FIELD_SCREEN_READER_TEXT_CLEAR_BUTTON,
},
icons: {
clear: <Icon src={Close} />,
submit: <Icon src={Search} />,
clear: Close,
submit: Search,
},
onBlur: () => {},
onChange: () => {},
Expand Down

0 comments on commit 56ba018

Please sign in to comment.