Fix search issue

This commit is contained in:
Hazem Krimi
2021-09-20 21:23:38 +01:00
parent 60d7aae725
commit d8298b6326
2 changed files with 11 additions and 1 deletions
+7 -1
View File
@@ -22,7 +22,13 @@ const SearchBar: React.FC = () => {
onKeyUp={search}
onChange={(event: React.ChangeEvent<HTMLInputElement>) => setQuery(event.target.value)}
/>
<img src={SearchIcon} alt='Search icon' />
<img
src={SearchIcon}
alt='Search icon'
onClick={() => {
if (query !== '') history.push(`/search/${query}`);
}}
/>
</Wrapper>
);
};
+4
View File
@@ -10,6 +10,10 @@ export const Wrapper = styled.div`
border-radius: 5px;
justify-self: flex-end;
padding: 0.2rem 0.5rem;
img {
cursor: pointer;
}
`;
export const Input = styled.input`