Browse Source

feat: Added redirected sites to Router

master
Denis Thiessen 5 months ago
parent
commit
b107c6c531
  1. 54
      src/App.js

54
src/App.js

@ -6,6 +6,14 @@ import { createStore } from "zustand/vanilla";
import { persist, createJSONStorage } from "zustand/middleware"; import { persist, createJSONStorage } from "zustand/middleware";
import { PARTICIPANT_NUMBER } from "./core/Constants"; import { PARTICIPANT_NUMBER } from "./core/Constants";
import { StudySite } from "./components/webpage_container/StudySite"; import { StudySite } from "./components/webpage_container/StudySite";
import StartPage5 from "./pages/study_site_5/StartPage5";
import StartPage6 from "./pages/study_site_6/StartPage6";
import StartPage4 from "./pages/study_site_4/StartPage4";
import StartPage3 from "./pages/study_site_3/StartPage3";
import DeliveryRegions from "./pages/study_site_6/DeliveryRegions";
import DownloadApp from "./pages/study_site_6/DownloadApp";
import HotelMap from "./pages/study_site_2/tab_content/HotelMap";
import RedirectPage from "./core/RedirectPage";
const NoPageFound = React.lazy(() => import("./pages/NoPageFound")); const NoPageFound = React.lazy(() => import("./pages/NoPageFound"));
const TestPage = React.lazy(() => import("./pages/TestPage")); const TestPage = React.lazy(() => import("./pages/TestPage"));
@ -15,7 +23,9 @@ const TestInfoPage2 = React.lazy(() => import("./pages/TestInfoPage2"));
const TestEndPage = React.lazy(() => import("./pages/TestEndPage")); const TestEndPage = React.lazy(() => import("./pages/TestEndPage"));
const StartPage1 = React.lazy(() => import("./pages/study_site_1/StartPage1")); const StartPage1 = React.lazy(() => import("./pages/study_site_1/StartPage1"));
const StartPage2 = React.lazy(() => import("./pages/study_site_2/StartPage2")); const StartPage2 = React.lazy(() => import("./pages/study_site_2/StartPage2"));
const TourOperators = React.lazy(() => import("./pages/study_site_2/TourOperators"));
const TourOperators = React.lazy(() =>
import("./pages/study_site_2/TourOperators")
);
export const sensorLogState = createStore( export const sensorLogState = createStore(
persist( persist(
@ -103,7 +113,7 @@ function App() {
}; };
wait(200); wait(200);
const latinSquareOrder = getLatinSquareOrder(PARTICIPANT_NUMBER); const latinSquareOrder = getLatinSquareOrder(PARTICIPANT_NUMBER);
return ( return (
@ -164,7 +174,7 @@ function App() {
path="/study-page-3" path="/study-page-3"
element={ element={
<React.Suspense fallback={<>...</>}> <React.Suspense fallback={<>...</>}>
<TestPage redirectLoc={latinSquareOrder[3]} />
<StartPage3 redirectLoc={latinSquareOrder[3]} />
</React.Suspense> </React.Suspense>
} }
/> />
@ -180,7 +190,7 @@ function App() {
path="/study-page-4" path="/study-page-4"
element={ element={
<React.Suspense fallback={<>...</>}> <React.Suspense fallback={<>...</>}>
<TestPage redirectLoc={latinSquareOrder[4]} />
<StartPage4 redirectLoc={latinSquareOrder[4]} />
</React.Suspense> </React.Suspense>
} }
/> />
@ -196,7 +206,7 @@ function App() {
path="/study-page-5" path="/study-page-5"
element={ element={
<React.Suspense fallback={<>...</>}> <React.Suspense fallback={<>...</>}>
<TestPage redirectLoc={latinSquareOrder[5]} />
<StartPage5 redirectLoc={latinSquareOrder[5]} />
</React.Suspense> </React.Suspense>
} }
/> />
@ -212,7 +222,7 @@ function App() {
path="/study-page-6" path="/study-page-6"
element={ element={
<React.Suspense fallback={<>...</>}> <React.Suspense fallback={<>...</>}>
<TestPage2 redirectLoc={latinSquareOrder[6]} />
<StartPage6 redirectLoc={latinSquareOrder[6]} />
</React.Suspense> </React.Suspense>
} }
/> />
@ -232,6 +242,38 @@ function App() {
</React.Suspense> </React.Suspense>
} }
/> />
<Route
path="/delivery_regions"
element={
<React.Suspense fallback={<>...</>}>
<DeliveryRegions />
</React.Suspense>
}
/>
<Route
path="/download_quickdeliver"
element={
<React.Suspense fallback={<>...</>}>
<DownloadApp />
</React.Suspense>
}
/>
<Route
path="/hotel_map"
element={
<React.Suspense fallback={<>...</>}>
<HotelMap />
</React.Suspense>
}
/>
<Route
path="/redirectPage/:url/:infoKey"
element={
<React.Suspense fallback={<>...</>}>
<RedirectPage />
</React.Suspense>
}
/>
<Route <Route
path="*" path="*"
element={ element={

Loading…
Cancel
Save