This commit is contained in:
Dave Richer
2023-12-11 17:34:05 -05:00
parent 5c164f807d
commit ad79344709
87 changed files with 1100 additions and 1113 deletions

View File

@@ -4,7 +4,7 @@ import LogRocket from "logrocket";
import React, { lazy, Suspense, useEffect } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { Route } from "react-router-dom";
import { Route, Routes } from "react-router-dom";
import { createStructuredSelector } from "reselect";
import DocumentEditorContainer from "../components/document-editor/document-editor.container";
import ErrorBoundary from "../components/error-boundary/error-boundary.component";
@@ -73,6 +73,7 @@ export function App({
window.addEventListener("online", function (e) {
setOnline(true);
});
useEffect(() => {
if (currentUser.authorized && bodyshop) {
client.setAttribute("imexshopid", bodyshop.imexshopid);
@@ -107,54 +108,77 @@ export function App({
/>
);
// <Switch>
// <Suspense fallback={<LoadingSpinner message="ImEX Online" />}>
// <ErrorBoundary>
// <Route exact path="/" component={LandingPage} />
// </ErrorBoundary>
// <ErrorBoundary>
// <Route exact path="/signin" component={SignInPage} />
// </ErrorBoundary>
// <ErrorBoundary>
// <Route exact path="/resetpassword" component={ResetPassword} />
// </ErrorBoundary>
// <ErrorBoundary>
// <Route exact path="/csi/:surveyId" component={CsiPage} />
// </ErrorBoundary>
// <ErrorBoundary>
// <Route exact path="/disclaimer" component={DisclaimerPage} />
// </ErrorBoundary>
// <ErrorBoundary>
// <Route
// exact
// path="/mp/:paymentIs"
// component={MobilePaymentContainer}
// />
// </ErrorBoundary>
// <ErrorBoundary>
// <PrivateRoute
// isAuthorized={currentUser.authorized}
// path="/manage"
// component={ManagePage}
// />
// </ErrorBoundary>
// <ErrorBoundary>
// <PrivateRoute
// isAuthorized={currentUser.authorized}
// path="/tech"
// component={TechPageContainer}
// />
// </ErrorBoundary>
// <ErrorBoundary>
// <PrivateRoute
// isAuthorized={currentUser.authorized}
// path="/edit"
// component={DocumentEditorContainer}
// />
// </ErrorBoundary>
// </Suspense>
// </Switch>
return (
<Switch>
<Suspense fallback={<LoadingSpinner message="ImEX Online" />}>
<ErrorBoundary>
<Route exact path="/" component={LandingPage} />
</ErrorBoundary>
<ErrorBoundary>
<Route exact path="/signin" component={SignInPage} />
</ErrorBoundary>
<ErrorBoundary>
<Route exact path="/resetpassword" component={ResetPassword} />
</ErrorBoundary>
<ErrorBoundary>
<Route exact path="/csi/:surveyId" component={CsiPage} />
</ErrorBoundary>
<ErrorBoundary>
<Route exact path="/disclaimer" component={DisclaimerPage} />
</ErrorBoundary>
<ErrorBoundary>
<Route
exact
path="/mp/:paymentIs"
component={MobilePaymentContainer}
/>
</ErrorBoundary>
<ErrorBoundary>
<PrivateRoute
isAuthorized={currentUser.authorized}
path="/manage"
component={ManagePage}
/>
</ErrorBoundary>
<ErrorBoundary>
<PrivateRoute
isAuthorized={currentUser.authorized}
path="/tech"
component={TechPageContainer}
/>
</ErrorBoundary>
<ErrorBoundary>
<PrivateRoute
isAuthorized={currentUser.authorized}
path="/edit"
component={DocumentEditorContainer}
/>
</ErrorBoundary>
</Suspense>
</Switch>
<Suspense fallback={<LoadingSpinner message="ImEX Online" />}>
<ErrorBoundary>
<Routes>
<Route path="/" element={<LandingPage />} />
<Route path="/signin" element={<SignInPage />} />
<Route path="/resetpassword" element={<ResetPassword />} />
<Route path="/csi/:surveyId" element={<CsiPage />} />
<Route path="/disclaimer" element={<DisclaimerPage />} />
<Route path="/mp/:paymentIs" element={<MobilePaymentContainer />} />
<Route path="/manage" element={<PrivateRoute isAuthorized={currentUser.authorized} />}>
<Route path="/manage" element={<ManagePage />} />
</Route>
<Route path="/tech" element={<PrivateRoute isAuthorized={currentUser.authorized} />}>
<Route path="/tech" element={<TechPageContainer />} />
</Route>
<Route path="/edit" element={<PrivateRoute isAuthorized={currentUser.authorized} />}>
<Route path="/edit" element={<DocumentEditorContainer />} />
</Route>
</Routes>
</ErrorBoundary>
</Suspense>
);
}