From 10e146ef0215d41527f0466b0e139a6805b96540 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 8 Aug 2020 09:33:45 +0300 Subject: refactor: remove urls file --- src/pages/Page.tsx | 13 ++++++------- src/pages/ProfilePage/ProfilePage.tsx | 5 ++--- src/pages/urls.ts | 8 -------- 3 files changed, 8 insertions(+), 18 deletions(-) delete mode 100644 src/pages/urls.ts (limited to 'src/pages') diff --git a/src/pages/Page.tsx b/src/pages/Page.tsx index dd413bf..34a1046 100644 --- a/src/pages/Page.tsx +++ b/src/pages/Page.tsx @@ -11,7 +11,6 @@ import RegistrationPage from './RegistrationPage/RegistrationPage'; import HomePage from './HomePage/HomePage'; import NotificationsPage from './NotificationsPage/NotificationsPage'; import Route from './Route'; -import urls from './urls'; const useStyles = makeStyles(theme => ({ @@ -41,12 +40,12 @@ const Page: React.FC = () => { >
- - - - - - + + + + + +
diff --git a/src/pages/ProfilePage/ProfilePage.tsx b/src/pages/ProfilePage/ProfilePage.tsx index ec917fd..b81c70f 100644 --- a/src/pages/ProfilePage/ProfilePage.tsx +++ b/src/pages/ProfilePage/ProfilePage.tsx @@ -7,7 +7,6 @@ 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 = () => { @@ -24,8 +23,8 @@ const ProfilePage: React.FC = () => { setIsInfoLoading(true); const redirect = () => { - if (user) history.push(urls.profile(user.username)); - else history.push(urls.login); + if (user) history.push(`/profile/${user.username}`); + else history.push('/login'); }; if (username) { diff --git a/src/pages/urls.ts b/src/pages/urls.ts deleted file mode 100644 index e10edac..0000000 --- a/src/pages/urls.ts +++ /dev/null @@ -1,8 +0,0 @@ -export default { - home: '/', - login: '/login', - registration: '/registration', - profile: (username: string = '') => `/profile/${username.toLowerCase()}`, - feed: '/feed', - notifications: '/notifications' -}; -- cgit v1.2.3