2021-03-26 04:17:02 +04:30
|
|
|
/*
|
|
|
|
|
* Copyright (C) Contributors to the Suwayomi project
|
|
|
|
|
*
|
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
2021-01-26 23:32:12 +03:30
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
2023-05-18 13:17:41 +02:00
|
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
|
*/
|
2021-01-26 23:32:12 +03:30
|
|
|
|
2021-11-15 19:33:48 +03:30
|
|
|
import { Container } from '@mui/material';
|
2021-09-09 17:51:22 +04:30
|
|
|
import CssBaseline from '@mui/material/CssBaseline';
|
2022-11-26 13:51:56 +01:00
|
|
|
import AppContext from 'components/context/AppContext';
|
2021-10-30 16:10:34 +03:30
|
|
|
import DefaultNavBar from 'components/navbar/DefaultNavBar';
|
2022-11-26 13:51:56 +01:00
|
|
|
import React from 'react';
|
2023-06-04 21:30:15 +02:00
|
|
|
import { Navigate, Route, Routes } from 'react-router-dom';
|
2022-11-26 13:51:56 +01:00
|
|
|
import Browse from 'screens/Browse';
|
|
|
|
|
import DownloadQueue from 'screens/DownloadQueue';
|
|
|
|
|
import Extensions from 'screens/Extensions';
|
|
|
|
|
import Library from 'screens/Library';
|
|
|
|
|
import Manga from 'screens/Manga';
|
|
|
|
|
import Reader from 'screens/Reader';
|
|
|
|
|
import SearchAll from 'screens/SearchAll';
|
2021-05-27 05:13:01 +04:30
|
|
|
import Settings from 'screens/Settings';
|
|
|
|
|
import About from 'screens/settings/About';
|
|
|
|
|
import Backup from 'screens/settings/Backup';
|
2022-11-26 13:51:56 +01:00
|
|
|
import Categories from 'screens/settings/Categories';
|
2023-01-06 17:34:16 +01:00
|
|
|
import DefaultReaderSettings from 'screens/settings/DefaultReaderSettings';
|
2021-10-30 16:16:36 +03:30
|
|
|
import SourceConfigure from 'screens/SourceConfigure';
|
|
|
|
|
import SourceMangas from 'screens/SourceMangas';
|
2021-10-30 16:34:09 +03:30
|
|
|
import Sources from 'screens/Sources';
|
2022-11-26 13:51:56 +01:00
|
|
|
import Updates from 'screens/Updates';
|
2023-02-13 20:20:08 +03:30
|
|
|
import 'i18n';
|
2023-04-22 13:03:51 +02:00
|
|
|
import LibrarySettings from 'screens/settings/LibrarySettings';
|
2021-09-09 17:51:22 +04:30
|
|
|
|
2022-11-26 13:51:56 +01:00
|
|
|
const App: React.FC = () => (
|
|
|
|
|
<AppContext>
|
|
|
|
|
<CssBaseline />
|
|
|
|
|
<DefaultNavBar />
|
|
|
|
|
<Container
|
|
|
|
|
id="appMainContainer"
|
|
|
|
|
maxWidth={false}
|
|
|
|
|
disableGutters
|
|
|
|
|
sx={{
|
|
|
|
|
mt: 8,
|
|
|
|
|
ml: { sm: 8 },
|
|
|
|
|
mb: { xs: 8, sm: 0 },
|
|
|
|
|
width: 'auto',
|
|
|
|
|
overflow: 'auto',
|
|
|
|
|
}}
|
|
|
|
|
>
|
2023-06-04 21:30:15 +02:00
|
|
|
<Routes>
|
2022-11-26 13:51:56 +01:00
|
|
|
{/* General Routes */}
|
2023-06-04 21:30:15 +02:00
|
|
|
<Route path="/" element={<Navigate to="/library" />} />
|
|
|
|
|
<Route path="settings">
|
|
|
|
|
<Route index element={<Settings />} />
|
|
|
|
|
<Route path="about" element={<About />} />
|
|
|
|
|
<Route path="categories" element={<Categories />} />
|
|
|
|
|
<Route path="defaultReaderSettings" element={<DefaultReaderSettings />} />
|
|
|
|
|
<Route path="librarySettings" element={<LibrarySettings />} />
|
|
|
|
|
<Route path="backup" element={<Backup />} />
|
2022-11-26 13:51:56 +01:00
|
|
|
</Route>
|
2021-03-18 21:46:24 +03:30
|
|
|
|
2022-11-26 13:51:56 +01:00
|
|
|
{/* Manga Routes */}
|
2021-01-23 01:20:16 +03:30
|
|
|
|
2023-06-04 21:30:15 +02:00
|
|
|
<Route path="sources">
|
|
|
|
|
<Route index element={<Sources />} />
|
|
|
|
|
<Route path=":sourceId" element={<SourceMangas />} />
|
|
|
|
|
<Route path=":sourceId/configure/" element={<SourceConfigure />} />
|
|
|
|
|
<Route path="all/search/" element={<SearchAll />} />
|
|
|
|
|
</Route>
|
|
|
|
|
<Route path="downloads" element={<DownloadQueue />} />
|
|
|
|
|
<Route path="manga/:id">
|
|
|
|
|
<Route path="chapter/:chapterNum" element={null} />
|
|
|
|
|
<Route index element={<Manga />} />
|
|
|
|
|
</Route>
|
|
|
|
|
<Route path="library" element={<Library />} />
|
|
|
|
|
<Route path="updates" element={<Updates />} />
|
|
|
|
|
<Route path="extensions" element={<Extensions />} />
|
|
|
|
|
<Route path="browse" element={<Browse />} />
|
|
|
|
|
</Routes>
|
2022-11-26 13:51:56 +01:00
|
|
|
</Container>
|
2023-06-04 21:30:15 +02:00
|
|
|
<Routes>
|
|
|
|
|
<Route path="manga/:mangaId/chapter/:chapterIndex" element={<Reader />} />
|
|
|
|
|
<Route path="*" element={null} />
|
|
|
|
|
</Routes>
|
2022-11-26 13:51:56 +01:00
|
|
|
</AppContext>
|
|
|
|
|
);
|
2022-11-02 10:42:02 +01:00
|
|
|
|
2022-11-26 13:51:56 +01:00
|
|
|
export default App;
|