mirror of
https://github.com/idanoo/autobrr
synced 2025-07-25 01:39:13 +00:00
refactor(web): update to react 18 and other deps (#285)
* Started refactoring codebase for React 18. * Migrated to react-router v6 fully * Removed useless test setup along with relevant packages. * Removed leftover console.log statement * feat: use status forbidden for onboarding * refactor(web): use react hook form on login * fix: comply with r18 shenanigans * chore: update packages
This commit is contained in:
parent
d065fee16b
commit
4d753b76ed
24 changed files with 2252 additions and 2145 deletions
55
web/src/domain/routes.tsx
Normal file
55
web/src/domain/routes.tsx
Normal file
|
@ -0,0 +1,55 @@
|
|||
import { BrowserRouter, Routes, Route } from "react-router-dom";
|
||||
|
||||
import { Login } from "../screens/auth/login";
|
||||
import { Logout } from "../screens/auth/logout";
|
||||
import { Onboarding } from "../screens/auth/onboarding";
|
||||
import Base from "../screens/Base";
|
||||
import { Dashboard } from "../screens/dashboard";
|
||||
import { FilterDetails, Filters } from "../screens/filters";
|
||||
import { Logs } from "../screens/Logs";
|
||||
import { Releases } from "../screens/releases";
|
||||
import Settings from "../screens/Settings";
|
||||
import ApplicationSettings from "../screens/settings/Application";
|
||||
import DownloadClientSettings from "../screens/settings/DownloadClient";
|
||||
import FeedSettings from "../screens/settings/Feed";
|
||||
import IndexerSettings from "../screens/settings/Indexer";
|
||||
import { IrcSettings } from "../screens/settings/Irc";
|
||||
import NotificationSettings from "../screens/settings/Notifications";
|
||||
import { RegexPlayground } from "../screens/settings/RegexPlayground";
|
||||
import ReleaseSettings from "../screens/settings/Releases";
|
||||
|
||||
import { baseUrl } from "../utils";
|
||||
|
||||
export const LocalRouter = ({ isLoggedIn }: { isLoggedIn: boolean }) => (
|
||||
<BrowserRouter basename={baseUrl()}>
|
||||
{isLoggedIn ? (
|
||||
<Routes>
|
||||
<Route path="/logout" element={<Logout />} />
|
||||
<Route element={<Base />}>
|
||||
<Route index element={<Dashboard />} />
|
||||
<Route path="logs" element={<Logs />} />
|
||||
<Route path="releases" element={<Releases />} />
|
||||
<Route path="filters">
|
||||
<Route index element={<Filters />} />
|
||||
<Route path=":filterId/*" element={<FilterDetails />} />
|
||||
</Route>
|
||||
<Route path="settings" element={<Settings />}>
|
||||
<Route index element={<ApplicationSettings />} />
|
||||
<Route path="indexers" element={<IndexerSettings />} />
|
||||
<Route path="feeds" element={<FeedSettings />} />
|
||||
<Route path="irc" element={<IrcSettings />} />
|
||||
<Route path="clients" element={<DownloadClientSettings />} />
|
||||
<Route path="notifications" element={<NotificationSettings />} />
|
||||
<Route path="releases" element={<ReleaseSettings />} />
|
||||
<Route path="regex-playground" element={<RegexPlayground />} />
|
||||
</Route>
|
||||
</Route>
|
||||
</Routes>
|
||||
) : (
|
||||
<Routes>
|
||||
<Route path="/onboard" element={<Onboarding />} />
|
||||
<Route path="*" element={<Login />} />
|
||||
</Routes>
|
||||
)}
|
||||
</BrowserRouter>
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue