aboutsummaryrefslogtreecommitdiff
path: root/src/pages
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/Page.tsx13
-rw-r--r--src/pages/ProfilePage/ProfilePage.tsx5
-rw-r--r--src/pages/urls.ts8
3 files changed, 8 insertions, 18 deletions
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 = () => {
>
<div className={classes.root}>
<Switch>
- <Route exact path={urls.home} component={HomePage} />
- <Route exact path={urls.login} component={LoginPage} />
- <Route exact path={urls.registration} component={RegistrationPage} />
- <Route exact path={urls.feed} component={FeedPage} />
- <Route exact path={urls.notifications} component={NotificationsPage} />
- <Route path={urls.profile(':username')} component={ProfilePage} />
+ <Route exact path="/" component={HomePage} />
+ <Route exact path="/login" component={LoginPage} />
+ <Route exact path="/registration" component={RegistrationPage} />
+ <Route exact path="/feed" component={FeedPage} />
+ <Route exact path="/notifications" component={NotificationsPage} />
+ <Route path="/profile/:username" component={ProfilePage} />
</Switch>
</div>
</SnackbarProvider>
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'
-};