Move shared components to common layout
This commit is contained in:
parent
6101e04ca8
commit
d5e703287a
5 changed files with 39 additions and 31 deletions
|
@ -11,6 +11,8 @@ import { HistoryRouter } from 'components/router/HistoryRouter';
|
|||
import { ApiProvider } from 'hooks/useApi';
|
||||
import { WebConfigProvider } from 'hooks/useWebConfig';
|
||||
import theme from 'themes/theme';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { DASHBOARD_APP_PATHS } from './apps/dashboard/App';
|
||||
|
||||
const DashboardApp = loadable(() => import('./apps/dashboard/App'));
|
||||
const ExperimentalApp = loadable(() => import('./apps/experimental/App'));
|
||||
|
@ -22,10 +24,14 @@ const RootAppLayout = () => {
|
|||
const layoutMode = localStorage.getItem('layout');
|
||||
const isExperimentalLayout = layoutMode === 'experimental';
|
||||
|
||||
const location = useLocation();
|
||||
const isNewLayoutPath = Object.values(DASHBOARD_APP_PATHS)
|
||||
.some(path => location.pathname.startsWith(`/${path}`));
|
||||
|
||||
return (
|
||||
<>
|
||||
<Backdrop />
|
||||
<AppHeader isHidden={isExperimentalLayout} />
|
||||
<AppHeader isHidden={isExperimentalLayout || isNewLayoutPath} />
|
||||
|
||||
{
|
||||
isExperimentalLayout ?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue