From 1d5803fff17c0bbc5709de0b92b862d20a7f728b Mon Sep 17 00:00:00 2001 From: iVladyuser Date: Sat, 4 Nov 2023 15:27:48 +0100 Subject: [PATCH] probe --- src/components/App.jsx | 6 +++--- src/components/Searchbar/Searchbar.jsx | 15 ++++++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/components/App.jsx b/src/components/App.jsx index d1f048d..afca25f 100644 --- a/src/components/App.jsx +++ b/src/components/App.jsx @@ -27,9 +27,9 @@ function App() { addPhotoPage(search, page); }, [search, page]); - const onSubmitSearchBar = event => { - event.preventDefault(); - const form = event.currentTarget; + const onSubmitSearchBar = ({form}) => { + // event.preventDefault(); + // const form = event.currentTarget; const searchValue = form.search.value .trim() .toLowerCase() diff --git a/src/components/Searchbar/Searchbar.jsx b/src/components/Searchbar/Searchbar.jsx index cd5a76f..9c4a740 100644 --- a/src/components/Searchbar/Searchbar.jsx +++ b/src/components/Searchbar/Searchbar.jsx @@ -7,9 +7,14 @@ import { SearchFormInput, } from './Searchbar.styles'; -const Searchbar = ({ onSubmitSearchBar }) => ( +const Searchbar = () => { + const handleSubmit = event => { + event.preventDefault(); + const form = event.currentTarget; + return form; + }; - + Search @@ -21,10 +26,10 @@ const Searchbar = ({ onSubmitSearchBar }) => ( autoComplete="off" autoFocus placeholder="Search images - and photos" + and photos" > - -); + ; +}; export default Searchbar;