blob: 7067eea03009a8d016fb105c5546c8645fe507ab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import React from 'react';
import { Switch, Route } from 'react-router-dom';
const Profile = React.lazy(() => import('../Profile/Profile'));
const Feed = React.lazy(() => import('../Feed/Feed'));
const Login = React.lazy(() => import('../Login/Login'));
const Registration = React.lazy(() => import('../Registration/Registration'));
const Home = React.lazy(() => import('../Home/Home'));
const Notifications = React.lazy(() => import('../Notifications/Notifications'));
const PollCreation = React.lazy(() => import('../PollCreation/PollCreation'));
const Router: React.FC = React.memo(() => (
<Switch>
<Route exact path="/" component={Home} />
<Route exact path="/login" component={Login} />
<Route exact path="/registration" component={Registration} />
<Route exact path="/feed" component={Feed} />
<Route exact path="/notifications" component={Notifications} />
<Route exact path="/new" component={PollCreation} />
<Route path="/profile/:username" component={Profile} />
</Switch>
));
export default Router;
|