From 5ca84ded5a1500ad3ea8d029b71488e8b3b74181 Mon Sep 17 00:00:00 2001 From: eug-vs <eug-vs@keemail.me> Date: Sat, 15 Aug 2020 03:55:27 +0300 Subject: feat: ping server before showing content --- src/containers/Page/Router.tsx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/containers/Page/Router.tsx (limited to 'src/containers/Page/Router.tsx') 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; + -- cgit v1.2.3