Skip to content

Commit 94734f6

Browse files
committed
create Loadable files
1 parent 3c816d8 commit 94734f6

File tree

9 files changed

+74
-43
lines changed

9 files changed

+74
-43
lines changed

src/containers/About/Loadable.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import Loadable from 'react-loadable';
3+
4+
const AboutLoadable = Loadable({
5+
loader: () => import('./About'),
6+
loading: () => <div>Loading</div>
7+
});
8+
9+
export default AboutLoadable;

src/containers/Chat/Loadable.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import React from 'react';
22
import Loadable from 'react-loadable';
33

4-
export default Loadable({
4+
const ChatLoadable = Loadable({
55
loader: () => import('./Chat'),
66
loading: () => <div>Loading</div>
77
});
8+
9+
export default ChatLoadable;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import Loadable from 'react-loadable';
3+
4+
const ChatFeathersLoadable = Loadable({
5+
loader: () => import('./ChatFeathers'),
6+
loading: () => <div>Loading</div>
7+
});
8+
9+
export default ChatFeathersLoadable;

src/containers/Login/Loadable.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import Loadable from 'react-loadable';
3+
4+
const LoginLoadable = Loadable({
5+
loader: () => import('./Login'),
6+
loading: () => <div>Loading</div>
7+
});
8+
9+
export default LoginLoadable;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import Loadable from 'react-loadable';
3+
4+
const LoginSuccessLoadable = Loadable({
5+
loader: () => import('./LoginSuccess'),
6+
loading: () => <div>Loading</div>
7+
});
8+
9+
export default LoginSuccessLoadable;

src/containers/Register/Loadable.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import Loadable from 'react-loadable';
3+
4+
const RegisterLoadable = Loadable({
5+
loader: () => import('./Register'),
6+
loading: () => <div>Loading</div>
7+
});
8+
9+
export default RegisterLoadable;

src/containers/Survey/Loadable.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import Loadable from 'react-loadable';
3+
4+
const SurveyLoadable = Loadable({
5+
loader: () => import('./Survey'),
6+
loading: () => <div>Loading</div>
7+
});
8+
9+
export default SurveyLoadable;

src/containers/Widgets/Loadable.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import Loadable from 'react-loadable';
3+
4+
const WidgetsLoadable = Loadable({
5+
loader: () => import('./Widgets'),
6+
loading: () => <div>Loading</div>
7+
});
8+
9+
export default WidgetsLoadable;

src/routes.js

Lines changed: 8 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,14 @@
1-
import React from 'react';
2-
import Loadable from 'react-loadable';
31
import { routerActions } from 'react-router-redux';
42
import { connectedReduxRedirect } from 'redux-auth-wrapper/history4/redirect';
53
import { App, Home, NotFound } from 'containers';
6-
7-
const About = Loadable({
8-
loader: () => import('./containers/About/About'),
9-
loading: () => <div>Loading</div>
10-
});
11-
12-
const Chat = Loadable({
13-
loader: () => import('./containers/Chat/Chat'),
14-
loading: () => <div>Loading</div>
15-
});
16-
17-
const ChatFeathers = Loadable({
18-
loader: () => import('./containers/ChatFeathers/ChatFeathers'),
19-
loading: () => <div>Loading</div>
20-
});
21-
22-
const Login = Loadable({
23-
loader: () => import('./containers/Login/Login'),
24-
loading: () => <div>Loading</div>
25-
});
26-
27-
const LoginSuccess = Loadable({
28-
loader: () => import('./containers/LoginSuccess/LoginSuccess'),
29-
loading: () => <div>Loading</div>
30-
});
31-
32-
const Register = Loadable({
33-
loader: () => import('./containers/Register/Register'),
34-
loading: () => <div>Loading</div>
35-
});
36-
37-
const Survey = Loadable({
38-
loader: () => import('./containers/Survey/Survey'),
39-
loading: () => <div>Loading</div>
40-
});
41-
42-
const Widgets = Loadable({
43-
loader: () => import('./containers/Widgets/Widgets'),
44-
loading: () => <div>Loading</div>
45-
});
4+
import About from 'containers/About/Loadable';
5+
import Chat from 'containers/Chat/Loadable';
6+
import ChatFeathers from 'containers/ChatFeathers/Loadable';
7+
import Login from 'containers/Login/Loadable';
8+
import LoginSuccess from 'containers/LoginSuccess/Loadable';
9+
import Register from 'containers/Register/Loadable';
10+
import Survey from 'containers/Survey/Loadable';
11+
import Widgets from 'containers/Widgets/Loadable';
4612

4713
const isAuthenticated = connectedReduxRedirect({
4814
redirectPath: '/login',

0 commit comments

Comments
 (0)