diff options
-rw-r--r-- | src/components/Header/SearchBar.tsx | 5 | ||||
-rw-r--r-- | src/hooks/useNavigate.tsx | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/components/Header/SearchBar.tsx b/src/components/Header/SearchBar.tsx index 253e77f..ba0943b 100644 --- a/src/components/Header/SearchBar.tsx +++ b/src/components/Header/SearchBar.tsx @@ -31,6 +31,9 @@ const useStyles = makeStyles(theme => ({ position: 'absolute', width: '100%', top: theme.spacing(5) + }, + listItem: { + padding: 0 } })); @@ -77,7 +80,7 @@ const SearchBar: React.FC = () => { { results.map((result, index) => ( <div key={result._id}> - <ListItem button onClick={handleNavigate(index)}> + <ListItem button onClick={handleNavigate(index)} className={classes.listItem}> <UserStrip user={result} /> </ListItem> {(index < results.length - 1) && <Divider />} diff --git a/src/hooks/useNavigate.tsx b/src/hooks/useNavigate.tsx index befc529..47de4df 100644 --- a/src/hooks/useNavigate.tsx +++ b/src/hooks/useNavigate.tsx @@ -24,6 +24,7 @@ const useProvideNavigation = () => { const navigate: ContextType['navigate'] = (prefix, id?) => { setPage({ prefix, id }); + window.scrollTo(0, 0); }; return { page, setPage, navigate }; |