From ab423a514d7564aa86a2d2a531d55af3c5bf98de Mon Sep 17 00:00:00 2001 From: noa Date: Sun, 10 Jul 2022 11:50:56 +0300 Subject: [PATCH] revert changes in useTranslator --- components/searchBar/SearchBar.language.json | 3 +++ components/searchBar/SearchBar.tsx | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 components/searchBar/SearchBar.language.json diff --git a/components/searchBar/SearchBar.language.json b/components/searchBar/SearchBar.language.json new file mode 100644 index 0000000..c5d3be0 --- /dev/null +++ b/components/searchBar/SearchBar.language.json @@ -0,0 +1,3 @@ +{ + "searchBarPlaceholder": "Search" +} diff --git a/components/searchBar/SearchBar.tsx b/components/searchBar/SearchBar.tsx index fee603f..f42de20 100644 --- a/components/searchBar/SearchBar.tsx +++ b/components/searchBar/SearchBar.tsx @@ -1,4 +1,6 @@ import React, { useCallback, ReactElement } from 'react'; +import { useTranslator } from '../language/useTranslator'; +import languageFile from './SearchBar.language.json'; import styles from './SearchBar.module.scss'; interface Props { @@ -16,6 +18,7 @@ const debounce = (callback, delay) => { const SearchBar = (props: Props): ReactElement => { const { handelSearch, placeholder } = props; + const searchPlaceholder = useTranslator('searchBarPlaceholder', languageFile); const debounceHandler = useCallback(debounce(handelSearch, 1000), []); @@ -29,7 +32,7 @@ const SearchBar = (props: Props): ReactElement => {