1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/src/apps/experimental/routes/routes.tsx

51 lines
1.7 KiB
TypeScript
Raw Normal View History

import React from 'react';
import { Navigate, RouteObject } from 'react-router-dom';
import { REDIRECTS } from 'apps/dashboard/routes/_redirects';
import ConnectionRequired from 'components/ConnectionRequired';
import { toAsyncPageRoute } from 'components/router/AsyncRoute';
2024-07-24 15:12:33 -04:00
import BangRedirect from 'components/router/BangRedirect';
import { toViewManagerPageRoute } from 'components/router/LegacyRoute';
import { toRedirectRoute } from 'components/router/Redirect';
2024-06-25 15:13:32 -04:00
import ErrorBoundary from 'components/router/ErrorBoundary';
import { ASYNC_USER_ROUTES } from './asyncRoutes';
import { LEGACY_PUBLIC_ROUTES, LEGACY_USER_ROUTES } from './legacyRoutes';
import VideoPage from './video';
export const EXPERIMENTAL_APP_ROUTES: RouteObject[] = [
{
path: '/*',
lazy: () => import('../AppLayout'),
children: [
{
/* User routes: Any child route of this layout is authenticated */
element: <ConnectionRequired isUserRequired />,
children: [
...ASYNC_USER_ROUTES.map(toAsyncPageRoute),
...LEGACY_USER_ROUTES.map(toViewManagerPageRoute),
// The video page is special since it combines new controls with the legacy view
{
path: 'video',
element: <VideoPage />
}
2024-06-25 15:13:32 -04:00
],
ErrorBoundary
},
/* Public routes */
{ index: true, element: <Navigate replace to='/home.html' /> },
...LEGACY_PUBLIC_ROUTES.map(toViewManagerPageRoute)
]
},
2024-07-24 15:12:33 -04:00
{
path: '!/*',
Component: BangRedirect
},
/* Redirects for old paths */
...REDIRECTS.map(toRedirectRoute)
];