fix(client): do not unmount default layout on navigate
This commit is contained in:
@ -5,6 +5,7 @@ import { Provider } from 'react-redux';
|
||||
import { createStore } from './src/redux/createStore';
|
||||
import AppMountNotifier from './src/components/AppMountNotifier';
|
||||
import GuideNavContextProvider from './src/contexts/GuideNavigationContext';
|
||||
import DefaultLayout from './src/components/layouts/Default';
|
||||
|
||||
const store = createStore();
|
||||
|
||||
@ -21,3 +22,23 @@ export const wrapRootElement = ({ element }) => {
|
||||
wrapRootElement.propTypes = {
|
||||
element: PropTypes.any
|
||||
};
|
||||
|
||||
export const wrapPageElement = ({ element, props }) => {
|
||||
const {
|
||||
location: { pathname }
|
||||
} = props;
|
||||
if (pathname === '/') {
|
||||
return (
|
||||
<DefaultLayout disableSettings={true} landingPage={true}>
|
||||
{element}
|
||||
</DefaultLayout>
|
||||
);
|
||||
}
|
||||
return <DefaultLayout>{element}</DefaultLayout>;
|
||||
};
|
||||
|
||||
wrapPageElement.propTypes = {
|
||||
element: PropTypes.any,
|
||||
location: PropTypes.objectOf({ pathname: PropTypes.string }),
|
||||
props: PropTypes.any
|
||||
};
|
||||
|
Reference in New Issue
Block a user