mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 20:53:24 +10:00
Move MobileFrame to app.js to prevent multiple instances
This commit is contained in:
parent
1f103a82f9
commit
6280d2da79
2 changed files with 22 additions and 21 deletions
10
src/app.js
10
src/app.js
|
|
@ -7,7 +7,7 @@ import { IntlProvider, addLocaleData } from 'react-intl';
|
|||
import en from 'react-intl/locale-data/en';
|
||||
import configureStore from './store';
|
||||
import Routes from './Routes';
|
||||
import { RoutesProvider } from './components';
|
||||
import { RoutesProvider, MobileFrame } from './components';
|
||||
import routesConfiguration from './routesConfiguration';
|
||||
import { flattenRoutes } from './util/routes';
|
||||
import localeData from './translations/en.json';
|
||||
|
|
@ -21,7 +21,9 @@ export const ClientApp = props => {
|
|||
<Provider store={store}>
|
||||
<RoutesProvider flattenedRoutes={flattenedRoutes}>
|
||||
<BrowserRouter>
|
||||
<Routes />
|
||||
<MobileFrame>
|
||||
<Routes />
|
||||
</MobileFrame>
|
||||
</BrowserRouter>
|
||||
</RoutesProvider>
|
||||
</Provider>
|
||||
|
|
@ -42,7 +44,9 @@ export const ServerApp = props => {
|
|||
<Provider store={store}>
|
||||
<RoutesProvider flattenedRoutes={flattenedRoutes}>
|
||||
<StaticRouter location={url} context={context}>
|
||||
<Routes />
|
||||
<MobileFrame>
|
||||
<Routes />
|
||||
</MobileFrame>
|
||||
</StaticRouter>
|
||||
</RoutesProvider>
|
||||
</Provider>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import Helmet from 'react-helmet';
|
|||
import { withRouter } from 'react-router-dom';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import { Topbar } from '../../containers';
|
||||
import { MobileFrame } from '../../components';
|
||||
|
||||
const scrollToTop = () => {
|
||||
// Todo: this might need fine tuning later
|
||||
|
|
@ -37,23 +36,21 @@ class PageLayout extends Component {
|
|||
/* eslint-enable no-console */
|
||||
|
||||
return (
|
||||
<MobileFrame>
|
||||
<div className={className}>
|
||||
<Helmet title={title} />
|
||||
{authInfoError
|
||||
? <div style={{ color: 'red' }}>
|
||||
<FormattedMessage id="PageLayout.authInfoFailed" />
|
||||
</div>
|
||||
: null}
|
||||
{logoutError
|
||||
? <div style={{ color: 'red' }}>
|
||||
<FormattedMessage id="PageLayout.logoutFailed" />
|
||||
</div>
|
||||
: null}
|
||||
<Topbar />
|
||||
{children}
|
||||
</div>
|
||||
</MobileFrame>
|
||||
<div className={className}>
|
||||
<Helmet title={title} />
|
||||
{authInfoError
|
||||
? <div style={{ color: 'red' }}>
|
||||
<FormattedMessage id="PageLayout.authInfoFailed" />
|
||||
</div>
|
||||
: null}
|
||||
{logoutError
|
||||
? <div style={{ color: 'red' }}>
|
||||
<FormattedMessage id="PageLayout.logoutFailed" />
|
||||
</div>
|
||||
: null}
|
||||
<Topbar />
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue