Skip to content

Commit

Permalink
Change prop name in SearchInput component
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Jun 18, 2020
1 parent 93ac131 commit e084989
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions react/components/AutocompleteInput/SearchInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,19 @@ const propTypes = {
/** Determine if the input and the button should be disabled */
disabled: PropTypes.bool,
/** Determine the search bar size */
barSize: PropTypes.string,
size: PropTypes.string,
}

const defaultProps = {
roundedBottom: true,
barSize: 'regular',
size: 'regular',
}

const SearchInput: React.FC<PropTypes.InferProps<typeof propTypes> &
Omit<React.HTMLProps<HTMLInputElement>, 'onChange' | 'value'>> = props => {
Omit<
React.HTMLProps<HTMLInputElement>,
'onChange' | 'value' | 'size'
>> = props => {
const {
onClear,
onSearch,
Expand All @@ -44,7 +47,7 @@ const SearchInput: React.FC<PropTypes.InferProps<typeof propTypes> &
onFocus,
onBlur,
disabled,
barSize,
size,
...inputProps
} = props

Expand Down Expand Up @@ -78,7 +81,7 @@ const SearchInput: React.FC<PropTypes.InferProps<typeof propTypes> &

const buttonClasses = classNames(
activeClass,
`bg-base br2 br--right w3 bw1 ba pa0 bl-0' h-${barSize}`,
`bg-base br2 br--right w3 bw1 ba pa0 bl-0' h-${size}`,
{
'c-link pointer': !disabled,
'c-disabled': disabled,
Expand All @@ -89,7 +92,7 @@ const SearchInput: React.FC<PropTypes.InferProps<typeof propTypes> &
<div className="flex flex-row">
<div className="relative w-100">
<input
className={`${activeClass} w-100 ma0 border-box bw1 br2 ba outline-0 c-on-base t-body ph5 pr8 br--left h-${barSize}`}
className={`${activeClass} w-100 ma0 border-box bw1 br2 ba outline-0 c-on-base t-body ph5 pr8 br--left h-${size}`}
value={value}
onFocus={handleFocus}
onBlur={handleBlur}
Expand Down
2 changes: 1 addition & 1 deletion react/components/AutocompleteInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ const AutocompleteInput: React.FunctionComponent<PropTypes.InferProps<
onSearch={() => onSearch(term)}
onClear={handleClear}
onChange={handleTermChange}
barSize={size}
size={size}
/>
{popoverOpened ? (
<div className="relative">
Expand Down

0 comments on commit e084989

Please sign in to comment.