Skip to content

Commit e8eedf9

Browse files
author
Jovert Lota Palonpon
committed
wip
1 parent 3147256 commit e8eedf9

File tree

6 files changed

+41
-30
lines changed

6 files changed

+41
-30
lines changed

resources/js/Backoffice.js

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Component } from 'react';
1+
import React, { Component, Suspense } from 'react';
22
import { HashRouter as Router } from 'react-router-dom';
33
import { withWidth, CssBaseline, MuiThemeProvider } from '@material-ui/core';
44

@@ -204,32 +204,38 @@ class Backoffice extends Component {
204204
const { width } = this.props;
205205
const { loading, nightMode } = this.state;
206206

207+
const renderLoading = (
208+
<Loading
209+
pageProps={{
210+
...this.state,
211+
}}
212+
/>
213+
);
214+
207215
return (
208216
<MuiThemeProvider theme={nightMode ? darkTheme : lightTheme}>
209217
<CssBaseline />
210218

211219
{loading ? (
212-
<Loading
213-
pageProps={{
214-
...this.state,
215-
}}
216-
/>
220+
renderLoading
217221
) : (
218222
<Router>
219-
<Navigator
220-
pageProps={{
221-
...this.state,
222-
width,
223-
environment: 'backoffice',
224-
routes: ROUTES,
225-
handleNightmodeToggled: this
226-
.handleNightmodeToggled,
227-
refresh: this.refresh,
228-
authenticate: this.authenticate,
229-
handleLock: this.handleLock,
230-
handleSignout: this.handleSignout,
231-
}}
232-
/>
223+
<Suspense fallback={renderLoading}>
224+
<Navigator
225+
pageProps={{
226+
...this.state,
227+
width,
228+
environment: 'backoffice',
229+
routes: ROUTES,
230+
handleNightmodeToggled: this
231+
.handleNightmodeToggled,
232+
refresh: this.refresh,
233+
authenticate: this.authenticate,
234+
handleLock: this.handleLock,
235+
handleSignout: this.handleSignout,
236+
}}
237+
/>
238+
</Suspense>
233239
</Router>
234240
)}
235241
</MuiThemeProvider>

resources/js/bootstrap.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import axios from 'axios';
2-
const moment = () => import('moment');
2+
import moment from 'moment';
33
import Lang from 'lang.js';
44

55
import { LOCALE } from './config';
@@ -23,7 +23,6 @@ if (token) {
2323

2424
/**
2525
* Here, we will initialize our localization for the first time.
26-
*
2726
*/
2827
window.Lang = new Lang({ messages: LOCALE });
2928

resources/js/icons/1x1/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
export { default as LightbulbOff } from './LightbulbOff';
2-
export { default as LightbulbOn } from './LightbulbOn';
1+
import loadable from '@loadable/component';
2+
3+
export const LightbulbOff = loadable(() => import('./LightbulbOff'));
4+
export const LightbulbOn = loadable(() => import('./LightbulbOn'));

resources/js/icons/flags/1x1/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
export { default as Ph } from './Ph';
2-
export { default as Us } from './Us';
1+
import loadable from '@loadable/component';
2+
3+
export const Ph = loadable(() => import('./Ph'));
4+
export const Us = loadable(() => import('./Us'));

resources/js/icons/flags/4x3/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
export { default as Ph } from './Ph';
2-
export { default as Us } from './Us';
1+
import loadable from '@loadable/component';
2+
3+
export const Ph = loadable(() => import('./Ph'));
4+
export const Us = loadable(() => import('./Us'));

resources/js/ui/Snackbar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const Snackbar = props => {
4545
if (action && actionText) {
4646
primaryAction = (
4747
<Button key="undo" color="inherit" size="small" onClick={action}>
48-
<Typography>{actionText}</Typography>
48+
<Typography color="inherit">{actionText}</Typography>
4949
</Button>
5050
);
5151
}
@@ -88,7 +88,7 @@ const Snackbar = props => {
8888
)}
8989
/>
9090

91-
<Typography>{body}</Typography>
91+
<Typography color="inherit">{body}</Typography>
9292
</span>
9393
}
9494
action={actions.reverse()}

0 commit comments

Comments
 (0)