Skip to content

Commit

Permalink
chore: move service context to root to do not reset services array
Browse files Browse the repository at this point in the history
  • Loading branch information
prosfus committed Nov 24, 2024
1 parent e96b750 commit 190a7b7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
27 changes: 12 additions & 15 deletions src/pages/ui/services/router.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Outlet, Route, Routes } from "react-router-dom";
import ServicesTopbar from "./components/Topbar";
import ServicesList from "./components/ServicesList";
import { ServicesProvider } from "./context/ServicesContext";
import ServiceForm from "./components/ServiceForm";
import FDLForm from "./components/FDL";
import ServiceLogs from "./components/ServiceLogs";
Expand All @@ -12,20 +11,18 @@ function ServicesRouter() {
<Route
path="/"
element={
<ServicesProvider>
<div
style={{
flexGrow: 1,
flexBasis: 0,
display: "flex",
flexDirection: "column",
}}
>
<ServicesTopbar />
<FDLForm />
<Outlet />
</div>
</ServicesProvider>
<div
style={{
flexGrow: 1,
flexBasis: 0,
display: "flex",
flexDirection: "column",
}}
>
<ServicesTopbar />
<FDLForm />
<Outlet />
</div>
}
>
<Route path="" element={<ServicesList />} />
Expand Down
9 changes: 6 additions & 3 deletions src/routes/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import TermsOfUse from "@/pages/TermsOfUse";
import { MinioProvider } from "@/contexts/Minio/MinioContext";
import MinioRouter from "@/pages/ui/minio/router";
import InfoView from "@/pages/ui/info";
import { ServicesProvider } from "@/pages/ui/services/context/ServicesContext";

function AppRouter() {
return (
Expand All @@ -17,9 +18,11 @@ function AppRouter() {
path="/ui"
element={
<ProtectedRoute>
<MinioProvider>
<AppLayout />
</MinioProvider>
<ServicesProvider>
<MinioProvider>
<AppLayout />
</MinioProvider>
</ServicesProvider>
</ProtectedRoute>
}
>
Expand Down

0 comments on commit 190a7b7

Please sign in to comment.