Skip to content

Commit

Permalink
use a const for translation
Browse files Browse the repository at this point in the history
  • Loading branch information
noamilsh committed Jul 3, 2022
1 parent 2411a13 commit 333a92b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/searchBar/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ const SearchBar = (props: Props): ReactElement => {
const { handelSearch, placeholder } = props;

const debounceHandler = useCallback(debounce(handelSearch, 1000), []);
const placeholderText = placeholder
? placeholder
: useTranslator('searchPlaceholder', languageFile);

const handleOnChange = async (event) => {
const { value } = event.currentTarget;
Expand All @@ -31,7 +34,7 @@ const SearchBar = (props: Props): ReactElement => {
<input
onChange={handleOnChange}
type="text"
placeholder={placeholder ? placeholder : useTranslator('searchPlaceholder', languageFile)}
placeholder={placeholderText}
className={styles.textBox}
/>
<svg
Expand Down

0 comments on commit 333a92b

Please sign in to comment.