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

Merge pull request #3706 from thornbill/react-router-3

Add react router and migrate search page
This commit is contained in:
Bill Thornton 2022-06-28 16:51:11 -04:00 committed by GitHub
commit c31e8968dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 407 additions and 60 deletions

View file

@ -308,12 +308,6 @@ import { appRouter } from '../components/appRouter';
type: 'home'
});
defineRoute({
alias: '/search.html',
path: 'search.html',
pageComponent: 'SearchPage'
});
defineRoute({
alias: '/list.html',
path: 'list.html',

View file

@ -7,6 +7,8 @@ import 'classlist.js';
import 'whatwg-fetch';
import 'resize-observer-polyfill';
import '../assets/css/site.scss';
import React from 'react';
import * as ReactDOM from 'react-dom';
import { Events } from 'jellyfin-apiclient';
import ServerConnections from '../components/ServerConnections';
import globalize from './globalize';
@ -18,7 +20,7 @@ import { appHost } from '../components/apphost';
import { getPlugins } from './settings/webSettings';
import { pluginManager } from '../components/pluginManager';
import packageManager from '../components/packageManager';
import { appRouter } from '../components/appRouter';
import { appRouter, history } from '../components/appRouter';
import '../elements/emby-button/emby-button';
import './autoThemes';
import './libraryMenu';
@ -40,6 +42,8 @@ import SyncPlayHtmlVideoPlayer from '../components/syncPlay/ui/players/HtmlVideo
import SyncPlayHtmlAudioPlayer from '../components/syncPlay/ui/players/HtmlAudioPlayer';
import { currentSettings } from './settings/userSettings';
import taskButton from './taskbutton';
import { HistoryRouter } from '../components/HistoryRouter.tsx';
import AppRoutes from '../routes/index.tsx';
function loadCoreDictionary() {
const languages = ['af', 'ar', 'be-by', 'bg-bg', 'bn_bd', 'ca', 'cs', 'cy', 'da', 'de', 'el', 'en-gb', 'en-us', 'eo', 'es', 'es-419', 'es-ar', 'es_do', 'es-mx', 'et', 'fa', 'fi', 'fil', 'fr', 'fr-ca', 'gl', 'gsw', 'he', 'hi-in', 'hr', 'hu', 'id', 'it', 'ja', 'kk', 'ko', 'lt-lt', 'lv', 'mr', 'ms', 'nb', 'nl', 'nn', 'pl', 'pr', 'pt', 'pt-br', 'pt-pt', 'ro', 'ru', 'sk', 'sl-si', 'sq', 'sv', 'ta', 'th', 'tr', 'uk', 'ur_pk', 'vi', 'zh-cn', 'zh-hk', 'zh-tw'];
@ -167,7 +171,14 @@ async function onAppReady() {
ServerConnections.currentApiClient()?.ensureWebSocket();
});
appRouter.start();
await appRouter.start();
ReactDOM.render(
<HistoryRouter history={history}>
<AppRoutes />
</HistoryRouter>,
document.getElementById('reactRoot')
);
if (!browser.tv && !browser.xboxOne && !browser.ps4) {
import('../components/nowPlayingBar/nowPlayingBar');