mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-25 07:47:55 +01:00
Add lazy loading.
This commit is contained in:
parent
cfa54fbe8c
commit
1e8685778d
@ -1,5 +1,5 @@
|
|||||||
import React, { ReactElement, Suspense } from 'react';
|
import React, { ReactElement, Suspense } from 'react';
|
||||||
import { IntlProvider } from 'react-intl';
|
import { FormattedMessage, IntlProvider } from 'react-intl';
|
||||||
import { Route, Switch, Redirect, BrowserRouter as Router } from 'react-router-dom';
|
import { Route, Switch, Redirect, BrowserRouter as Router } from 'react-router-dom';
|
||||||
import ForgotPasswordSuccessPage from './components/forgot-password-success-page';
|
import ForgotPasswordSuccessPage from './components/forgot-password-success-page';
|
||||||
import RegistationPage from './components/registration-page';
|
import RegistationPage from './components/registration-page';
|
||||||
@ -67,15 +67,35 @@ const App = (): ReactElement => {
|
|||||||
<Route path="/c/forgot-password" component={ForgotPasswordPage} />
|
<Route path="/c/forgot-password" component={ForgotPasswordPage} />
|
||||||
<Route path="/c/forgot-password-success" component={ForgotPasswordSuccessPage} />
|
<Route path="/c/forgot-password-success" component={ForgotPasswordSuccessPage} />
|
||||||
<Route exact path="/c/maps/">
|
<Route exact path="/c/maps/">
|
||||||
<Suspense fallback={<div></div>}>
|
<Suspense
|
||||||
|
fallback={
|
||||||
|
<div>
|
||||||
|
<FormattedMessage id="dialog.loading" defaultMessage="Loading ..." />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
>
|
||||||
<MapsPage />
|
<MapsPage />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</Route>
|
</Route>
|
||||||
<Route exact path="/c/maps/:id/edit">
|
<Route exact path="/c/maps/:id/edit">
|
||||||
<EnhacedEditorPage isTryMode={false} />
|
<Suspense
|
||||||
|
fallback={
|
||||||
|
<div>
|
||||||
|
<FormattedMessage id="dialog.loading" defaultMessage="Loading ..." />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<EnhacedEditorPage isTryMode={false} />
|
||||||
|
</Suspense>
|
||||||
</Route>
|
</Route>
|
||||||
<Route exact path="/c/maps/:id/try">
|
<Route exact path="/c/maps/:id/try">
|
||||||
<Suspense fallback={<div></div>}>
|
<Suspense
|
||||||
|
fallback={
|
||||||
|
<div>
|
||||||
|
<FormattedMessage id="dialog.loading" defaultMessage="Loading ..." />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
>
|
||||||
<EnhacedEditorPage isTryMode={true} />
|
<EnhacedEditorPage isTryMode={true} />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</Route>
|
</Route>
|
||||||
|
Loading…
Reference in New Issue
Block a user