From 0fe1f4138f870c4d00a02741bacf25165c94541e Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Sat, 8 Aug 2020 09:07:32 +0300
Subject: feat: support routing for UserStrip

---
 src/components/UserStrip/UserStrip.tsx | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'src/components/UserStrip/UserStrip.tsx')

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 = (
-- 
cgit v1.2.3

