Skip to content

Commit e084989

Browse files
author
=
committed
Change prop name in SearchInput component
1 parent 93ac131 commit e084989

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

react/components/AutocompleteInput/SearchInput/index.tsx

+9-6
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,19 @@ const propTypes = {
2525
/** Determine if the input and the button should be disabled */
2626
disabled: PropTypes.bool,
2727
/** Determine the search bar size */
28-
barSize: PropTypes.string,
28+
size: PropTypes.string,
2929
}
3030

3131
const defaultProps = {
3232
roundedBottom: true,
33-
barSize: 'regular',
33+
size: 'regular',
3434
}
3535

3636
const SearchInput: React.FC<PropTypes.InferProps<typeof propTypes> &
37-
Omit<React.HTMLProps<HTMLInputElement>, 'onChange' | 'value'>> = props => {
37+
Omit<
38+
React.HTMLProps<HTMLInputElement>,
39+
'onChange' | 'value' | 'size'
40+
>> = props => {
3841
const {
3942
onClear,
4043
onSearch,
@@ -44,7 +47,7 @@ const SearchInput: React.FC<PropTypes.InferProps<typeof propTypes> &
4447
onFocus,
4548
onBlur,
4649
disabled,
47-
barSize,
50+
size,
4851
...inputProps
4952
} = props
5053

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

7982
const buttonClasses = classNames(
8083
activeClass,
81-
`bg-base br2 br--right w3 bw1 ba pa0 bl-0' h-${barSize}`,
84+
`bg-base br2 br--right w3 bw1 ba pa0 bl-0' h-${size}`,
8285
{
8386
'c-link pointer': !disabled,
8487
'c-disabled': disabled,
@@ -89,7 +92,7 @@ const SearchInput: React.FC<PropTypes.InferProps<typeof propTypes> &
8992
<div className="flex flex-row">
9093
<div className="relative w-100">
9194
<input
92-
className={`${activeClass} w-100 ma0 border-box bw1 br2 ba outline-0 c-on-base t-body ph5 pr8 br--left h-${barSize}`}
95+
className={`${activeClass} w-100 ma0 border-box bw1 br2 ba outline-0 c-on-base t-body ph5 pr8 br--left h-${size}`}
9396
value={value}
9497
onFocus={handleFocus}
9598
onBlur={handleBlur}

react/components/AutocompleteInput/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ const AutocompleteInput: React.FunctionComponent<PropTypes.InferProps<
216216
onSearch={() => onSearch(term)}
217217
onClear={handleClear}
218218
onChange={handleTermChange}
219-
barSize={size}
219+
size={size}
220220
/>
221221
{popoverOpened ? (
222222
<div className="relative">

0 commit comments

Comments
 (0)