mirror of
https://github.com/idanoo/autobrr
synced 2025-07-25 17:59:14 +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
|
@ -1,15 +1,9 @@
|
|||
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
|
||||
import { QueryClient, QueryClientProvider, useQueryErrorResetBoundary } from "react-query";
|
||||
import { ReactQueryDevtools } from "react-query/devtools";
|
||||
import { ErrorBoundary } from "react-error-boundary";
|
||||
import { toast, Toaster } from "react-hot-toast";
|
||||
|
||||
import Base from "./screens/Base";
|
||||
import { Login } from "./screens/auth/login";
|
||||
import { Logout } from "./screens/auth/logout";
|
||||
import { Onboarding } from "./screens/auth/onboarding";
|
||||
|
||||
import { baseUrl } from "./utils";
|
||||
import { LocalRouter } from "./domain/routes";
|
||||
import { AuthContext, SettingsContext } from "./utils/Context";
|
||||
import { ErrorPage } from "./components/alerts";
|
||||
import Toast from "./components/notifications/Toast";
|
||||
|
@ -44,17 +38,7 @@ export function App() {
|
|||
onReset={reset}
|
||||
fallbackRender={ErrorPage}
|
||||
>
|
||||
<Router basename={baseUrl()}>
|
||||
<Route exact path="/logout" component={Logout} />
|
||||
{authContext.isLoggedIn ? (
|
||||
<Route component={Base} />
|
||||
) : (
|
||||
<Switch>
|
||||
<Route exact path="/onboard" component={Onboarding} />
|
||||
<Route component={Login} />
|
||||
</Switch>
|
||||
)}
|
||||
</Router>
|
||||
<LocalRouter isLoggedIn={authContext.isLoggedIn} />
|
||||
{settings.debug ? (
|
||||
<ReactQueryDevtools initialIsOpen={false} />
|
||||
) : null}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue