aboutsummaryrefslogtreecommitdiff
path: root/src/components/UserStrip/UserStrip.tsx
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-08-08 09:07:32 +0300
committereug-vs <eug-vs@keemail.me>2020-08-08 09:11:14 +0300
commit0fe1f4138f870c4d00a02741bacf25165c94541e (patch)
treec73df7a5df815a3c8cb0a777ef7475c399577cb9 /src/components/UserStrip/UserStrip.tsx
parent46e360a23969bde69f6d80b5ff27401a39169be6 (diff)
downloadwhich-ui-0fe1f4138f870c4d00a02741bacf25165c94541e.tar.gz
feat: support routing for UserStrip
Diffstat (limited to 'src/components/UserStrip/UserStrip.tsx')
-rw-r--r--src/components/UserStrip/UserStrip.tsx7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/components/UserStrip/UserStrip.tsx b/src/components/UserStrip/UserStrip.tsx
index 3ac47b3..a2d2700 100644
--- a/src/components/UserStrip/UserStrip.tsx
+++ b/src/components/UserStrip/UserStrip.tsx
@@ -1,10 +1,11 @@
import React from 'react';
+import { useHistory } from 'react-router-dom';
import { makeStyles } from '@material-ui/core/styles';
import VerifiedIcon from '@material-ui/icons/CheckCircleOutline';
import { Avatar, CardHeader } from '@material-ui/core/';
import { User } from 'which-types';
-import { useNavigate } from '../../hooks/useNavigate';
+import urls from '../../pages/urls';
interface PropTypes {
user: User;
@@ -30,11 +31,11 @@ const useStyles = makeStyles(theme => ({
const UserStrip: React.FC<PropTypes> = ({ user, info }) => {
const classes = useStyles();
- const { navigate } = useNavigate();
+ const history = useHistory();
const { username, avatarUrl, verified } = user;
const handleNavigate = () => {
- navigate('profile', user._id);
+ history.push(urls.profile(user.username));
};
const avatar = (