diff options
author | eug-vs <eug-vs@keemail.me> | 2020-08-08 09:07:32 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-08-08 09:11:14 +0300 |
commit | 0fe1f4138f870c4d00a02741bacf25165c94541e (patch) | |
tree | c73df7a5df815a3c8cb0a777ef7475c399577cb9 /src/pages/ProfilePage | |
parent | 46e360a23969bde69f6d80b5ff27401a39169be6 (diff) | |
download | which-ui-0fe1f4138f870c4d00a02741bacf25165c94541e.tar.gz |
feat: support routing for UserStrip
Diffstat (limited to 'src/pages/ProfilePage')
-rw-r--r-- | src/pages/ProfilePage/ProfilePage.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pages/ProfilePage/ProfilePage.tsx b/src/pages/ProfilePage/ProfilePage.tsx index b81c70f..ec917fd 100644 --- a/src/pages/ProfilePage/ProfilePage.tsx +++ b/src/pages/ProfilePage/ProfilePage.tsx @@ -7,6 +7,7 @@ import ProfileInfo from './ProfileInfo'; import Feed from '../../components/Feed/Feed'; import { get } from '../../requests'; import { useAuth } from '../../hooks/useAuth'; +import urls from '../urls'; const ProfilePage: React.FC = () => { @@ -23,8 +24,8 @@ const ProfilePage: React.FC = () => { setIsInfoLoading(true); const redirect = () => { - if (user) history.push(`/profile/${user.username}`); - else history.push('/login'); + if (user) history.push(urls.profile(user.username)); + else history.push(urls.login); }; if (username) { |