Skip to content

Commit

Permalink
probe
Browse files Browse the repository at this point in the history
  • Loading branch information
iVladyuser committed Nov 4, 2023
1 parent 64c89e8 commit 1d5803f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
15 changes: 10 additions & 5 deletions src/components/Searchbar/Searchbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
<SearchbarHeader>
<SearchForm onSubmit={onSubmitSearchBar}>
<SearchForm onSubmit={handleSubmit}>
<SearchFormButton type="submit">
<SearchFormButtonLabel>Search</SearchFormButtonLabel>
<BiSearch style={{ margin: 10, height: 20, width: 20 }} />
Expand All @@ -21,10 +26,10 @@ const Searchbar = ({ onSubmitSearchBar }) => (
autoComplete="off"
autoFocus
placeholder="Search images
and photos"
and photos"
></SearchFormInput>
</SearchForm>
</SearchbarHeader>
);
</SearchbarHeader>;
};

export default Searchbar;

0 comments on commit 1d5803f

Please sign in to comment.