Verified Commit 7772fcdd authored by Florent Chehab's avatar Florent Chehab
Browse files

fix(React): moved Services component to MainApp

* Prevents unmount / remount of theses component when invalidating major
API data.
parent 3f021561
......@@ -4,7 +4,6 @@
import React from "react";
import { compose } from "recompose";
import { Route, Switch } from "react-router-dom";
import FullScreenDialogServiceComponent from "../services/FullScreenDialogServiceComponent";
import { withErrorBoundary } from "../common/ErrorBoundary";
import PageMap from "../pages/PageMap";
......@@ -21,19 +20,16 @@ import { PageCgu, PageRgpd } from "../pages/PagesRgpdCgu";
import PageNotFound from "../pages/PageNotFound";
import PageEditPreviousExchanges from "../pages/PageEditExchangeFeedbacks";
import PageMyExchanges from "../pages/PageMyExchanges";
import NotifierImportantInformation from "./NotifierImportantInformation";
import FooterImportantInformation from "./FooterImportantInformation";
import PageAboutUnlinkedPartners from "../pages/PageAboutUnlinkedPartners";
import PageLogout from "../pages/PageLogout";
import withNetworkWrapper, { NetWrapParam } from "../../hoc/withNetworkWrapper";
import NotificationServiceComponent from "../services/NotificationServiceComponent";
import UniversityService from "../../services/data/UniversityService";
import CityService from "../../services/data/CityService";
import CountryService from "../../services/data/CountryService";
import CurrencyService from "../../services/data/CurrencyService";
import LanguageService from "../../services/data/LanguageService";
import FilterService from "../../services/FilterService";
import AlertServiceComponent from "../services/AlertServiceComponent";
import useOnBeforeComponentMount from "../../hooks/useOnBeforeComponentMount";
const SERVICES_TO_INITIALIZE = [
......@@ -65,10 +61,6 @@ function App() {
}}
>
<MainAppFrame>
<AlertServiceComponent />
<FullScreenDialogServiceComponent />
<NotificationServiceComponent />
<NotifierImportantInformation />
<main>
<Switch>
<Route exact path={APP_ROUTES.base} component={PageHome} />
......
......@@ -14,6 +14,10 @@ import ThemeProvider from "../components/common/theme/ThemeProvider";
import SnackbarCloseButton from "../components/app/SnackbarCloseButton";
import NavigationService from "../services/NavigationService";
import OfflineThemeProvider from "../components/common/theme/OfflineThemeProvider";
import AlertServiceComponent from "../components/services/AlertServiceComponent";
import FullScreenDialogServiceComponent from "../components/services/FullScreenDialogServiceComponent";
import NotificationServiceComponent from "../components/services/NotificationServiceComponent";
import NotifierImportantInformation from "../components/app/NotifierImportantInformation";
/**
* Get the correct style for a color of notistack (not enough contrast some times with default settings)
......@@ -61,6 +65,10 @@ function SubEntry() {
>
<>
<CssBaseline />
<AlertServiceComponent />
<FullScreenDialogServiceComponent />
<NotificationServiceComponent />
<NotifierImportantInformation />
<App />
</>
</SnackbarProvider>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment