From d8298b6326d1f81c04f1c5cf72071e3298ea1dd3 Mon Sep 17 00:00:00 2001 From: Hazem Krimi Date: Mon, 20 Sep 2021 21:23:38 +0100 Subject: [PATCH] Fix search issue --- src/components/SearchBar/index.tsx | 8 +++++++- src/components/SearchBar/styles.ts | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/SearchBar/index.tsx b/src/components/SearchBar/index.tsx index e571e01..40e9839 100644 --- a/src/components/SearchBar/index.tsx +++ b/src/components/SearchBar/index.tsx @@ -22,7 +22,13 @@ const SearchBar: React.FC = () => { onKeyUp={search} onChange={(event: React.ChangeEvent) => setQuery(event.target.value)} /> - Search icon + Search icon { + if (query !== '') history.push(`/search/${query}`); + }} + /> ); }; diff --git a/src/components/SearchBar/styles.ts b/src/components/SearchBar/styles.ts index 1d43c66..4480a8f 100644 --- a/src/components/SearchBar/styles.ts +++ b/src/components/SearchBar/styles.ts @@ -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`