aboutsummaryrefslogtreecommitdiff
path: root/src/components/Header
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/Header')
-rw-r--r--src/components/Header/Header.tsx11
-rw-r--r--src/components/Header/SearchBar.tsx4
2 files changed, 6 insertions, 9 deletions
diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx
index ef5f9fb..9c42c31 100644
--- a/src/components/Header/Header.tsx
+++ b/src/components/Header/Header.tsx
@@ -15,7 +15,6 @@ import HomeIcon from '@material-ui/icons/Home';
import { useAuth } from '../../hooks/useAuth';
import SearchBar from './SearchBar';
-import urls from '../../pages/urls';
const useStyles = makeStyles(theme => ({
@@ -51,20 +50,20 @@ const Header: React.FC = () => {
const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
const handleHome = (): void => {
- history.push(urls.home);
+ history.push('/');
};
const handleFeed = (): void => {
- history.push(urls.feed)
+ history.push('/feed')
};
const handleProfile = (): void => {
- if (user) history.push(urls.profile(user.username));
- else history.push(urls.login);
+ if (user) history.push(`/profile/${user.username}`);
+ else history.push('/login');
};
const handleNotifications = (): void => {
- history.push(urls.notifications);
+ history.push('/notifications');
};
const FeedButton = (
diff --git a/src/components/Header/SearchBar.tsx b/src/components/Header/SearchBar.tsx
index f54cf25..f541589 100644
--- a/src/components/Header/SearchBar.tsx
+++ b/src/components/Header/SearchBar.tsx
@@ -14,8 +14,6 @@ import { User } from 'which-types';
import { get } from '../../requests';
import UserStrip from '../UserStrip/UserStrip';
-import urls from '../../pages/urls';
-
const INTERVAL = 300;
const LIMIT = 7;
@@ -72,7 +70,7 @@ const SearchBar: React.FC = () => {
const handleNavigate = (index: number) => () => {
const { username } = results[index];
- history.push(urls.profile(username));
+ history.push(`/profile/${username}`);
handleClose();
};