diff options
author | Eugene Sokolov <eug-vs@keemail.me> | 2020-08-15 05:09:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-15 05:09:14 +0300 |
commit | 694918dcf0565e14dc4cba69e89907be9bed1544 (patch) | |
tree | ea5d41ef1878cef81d37125abe4a11d6018f130b /src/containers/Page/Router.tsx | |
parent | 5ef1984e869529bdae38332c9ecf59661e08c364 (diff) | |
parent | f2ad02d1f2aa5acaac430148dadfd2abc9e671e0 (diff) | |
download | which-ui-694918dcf0565e14dc4cba69e89907be9bed1544.tar.gz |
Merge pull request #84 from which-ecosystem/dyno-wakeup
Wakeup dyno before showing layout
Diffstat (limited to 'src/containers/Page/Router.tsx')
-rw-r--r-- | src/containers/Page/Router.tsx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/containers/Page/Router.tsx b/src/containers/Page/Router.tsx new file mode 100644 index 0000000..7067eea --- /dev/null +++ b/src/containers/Page/Router.tsx @@ -0,0 +1,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; + |