mirror of
https://github.com/hazemKrimi/react-weather-app.git
synced 2026-05-01 18:30:25 +00:00
Fix search issue
This commit is contained in:
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user