mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
chore: clean up react app layouts
This commit is contained in:
parent
68b21bbb04
commit
48524332dc
4 changed files with 55 additions and 39 deletions
|
@ -1,12 +1,24 @@
|
|||
import React from 'react';
|
||||
import { Outlet } from 'react-router-dom';
|
||||
import { Outlet, useLocation } from 'react-router-dom';
|
||||
|
||||
import AppBody from 'components/AppBody';
|
||||
import { DASHBOARD_APP_PATHS } from 'apps/dashboard/routes/routes';
|
||||
import Backdrop from 'components/Backdrop';
|
||||
import AppHeader from 'components/AppHeader';
|
||||
|
||||
export default function AppLayout() {
|
||||
const location = useLocation();
|
||||
const isNewLayoutPath = Object.values(DASHBOARD_APP_PATHS)
|
||||
.some(path => location.pathname.startsWith(`/${path}`));
|
||||
|
||||
return (
|
||||
<AppBody>
|
||||
<Outlet />
|
||||
</AppBody>
|
||||
<>
|
||||
<Backdrop />
|
||||
<AppHeader isHidden={isNewLayoutPath} />
|
||||
|
||||
<AppBody>
|
||||
<Outlet />
|
||||
</AppBody>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ const router = createHashRouter([
|
|||
...DASHBOARD_APP_ROUTES
|
||||
]);
|
||||
|
||||
export default function StableAppRouter({ history }: { history: History }) {
|
||||
export default function StableAppRouter({ history }: Readonly<{ history: History }>) {
|
||||
useLegacyRouterSync({ router, history });
|
||||
|
||||
return <RouterProvider router={router} />;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue