Skip to content

Commit

Permalink
Revert "Lazyload components with code splitting"
Browse files Browse the repository at this point in the history
This reverts commit 80509c9.
  • Loading branch information
jimmyzhen committed Jul 3, 2024
1 parent 80509c9 commit 7f2f879
Showing 1 changed file with 143 additions and 146 deletions.
289 changes: 143 additions & 146 deletions src/App/App.jsx
Original file line number Diff line number Diff line change
@@ -1,170 +1,167 @@
import React, { Suspense, lazy } from 'react';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import React from 'react';
import { Router, Route, Switch } from 'react-router-dom';
import { Provider } from 'react-redux';
import configureStore from './configureStore';
import 'bootstrap';
import History from './history';
import NavbarConnected from '../Navbar/navbar';
import Footer from '../Footer/footer';
import LandingPageConnected from '../LandingPage/landingPage';
import LinkoutPage from '../LinkoutPage/linkoutPage';
import AnalysisHomePageConnected from '../AnalysisPage/analysisHomePage';
import MethodsConnected from '../MethodsPage/methods';
import TeamPage from '../TeamPage/teamPage';
import Contact from '../ContactPage/contact';
import ErrorPageConnected from '../ErrorPage/error';
import ReleasePageConnected from '../ReleasePage/releasePage';
import DataStatusPageConnected from '../DataStatusPage/dataStatusPage';
import DataSummaryPageConnected from '../DataSummaryPage/dataSummaryPage';
import DataAccessPageConnected from '../DataAccess/dataAccessPage';
import RelatedStudy from '../RelatedStudy/relatedStudy';
import HeritageProteomics from '../RelatedStudy/heritageProteomics';
import AnnouncementsPage from '../AnnouncementsPage/announcementsPage';
import BrowseDataPageConnected from '../BrowseDataPage/browseDataPage';
import SearchPageConnected from '../Search/searchPage';
import GeneCentricViewConnected from '../AnalysisPage/GeneCentricViewRat/geneCentricViewPage';
import GraphicalClustering from '../AnalysisPage/GraphicalClustering/graphicalClusteringPage';
import CodeRepositories from '../CodeRepoPage/codeRepoPage';
import MainStudyConnected from '../MainStudy/mainStudy';
import Tutorials from '../Tutorials/tutorials';
import Publications from '../Publications/publications';
import MultiOmicsWorkingGroups from '../MultiOmicsWorkingGroups/multiOmicsWorkingGroups';
import FullTableEnduranceTraining from '../Publications/Data/Animal/Phenotype/fullTableEnduranceTraining';
import ClinicalStudyProtocols from '../Publications/Docs/Protocol/Clinical/clinicalStudyProtocols';
import Pass1b06PhenotypeAnimalConnected from '../AnalysisPage/pass1b06PhenotypeAnimal';
import CallbackConnected from '../Auth/callback';
import PrivateRoute from '../Auth/privateRoute';
import { withTracker } from '../GoogleAnalytics/googleAnalytics';
import PrivateRoute from '../Auth/privateRoute';
import ScrollToTop from '../lib/scrollToTop';

const LandingPageConnected = lazy(() => import('../LandingPage/landingPage'));
const BrowseDataPageConnected = lazy(() => import('../BrowseDataPage/browseDataPage'));
const SearchPageConnected = lazy(() => import('../Search/searchPage'));
const GeneCentricViewConnected = lazy(() => import('../AnalysisPage/GeneCentricViewRat/geneCentricViewPage'));
const GraphicalClustering = lazy(() => import('../AnalysisPage/GraphicalClustering/graphicalClusteringPage'));
const ReleasePageConnected = lazy(() => import('../ReleasePage/releasePage'));
const DataStatusPageConnected = lazy(() => import('../DataStatusPage/dataStatusPage'));
const DataSummaryPageConnected = lazy(() => import('../DataSummaryPage/dataSummaryPage'));
const DataAccessPageConnected = lazy(() => import('../DataAccess/dataAccessPage'));
const CodeRepositories = lazy(() => import('../CodeRepoPage/codeRepoPage'));
const MainStudyConnected = lazy(() => import('../MainStudy/mainStudy'));
const Tutorials = lazy(() => import('../Tutorials/tutorials'));
const Publications = lazy(() => import('../Publications/publications'));
const MultiOmicsWorkingGroups = lazy(() => import('../MultiOmicsWorkingGroups/multiOmicsWorkingGroups'));
const FullTableEnduranceTraining = lazy(() => import('../Publications/Data/Animal/Phenotype/fullTableEnduranceTraining'));
const ClinicalStudyProtocols = lazy(() => import('../Publications/Docs/Protocol/Clinical/clinicalStudyProtocols'));
const Pass1b06PhenotypeAnimalConnected = lazy(() => import('../AnalysisPage/pass1b06PhenotypeAnimal'));
const LinkoutPage = lazy(() => import('../LinkoutPage/linkoutPage'));
const AnalysisHomePageConnected = lazy(() => import('../AnalysisPage/analysisHomePage'));
const MethodsConnected = lazy(() => import('../MethodsPage/methods'));
const TeamPage = lazy(() => import('../TeamPage/teamPage'));
const Contact = lazy(() => import('../ContactPage/contact'));
const ErrorPageConnected = lazy(() => import('../ErrorPage/error'));
const RelatedStudy = lazy(() => import('../RelatedStudy/relatedStudy'));
const HeritageProteomics = lazy(() => import('../RelatedStudy/heritageProteomics'));
const AnnouncementsPage = lazy(() => import('../AnnouncementsPage/announcementsPage'));

const store = configureStore();

function App({ history = History }) {
return (
<Provider store={store}>
<Router>
<Router history={history}>
<ScrollToTop />
<div className="App container-fluid">
<header>
<NavbarConnected />
</header>
<div className="row justify-content-center">
<Suspense fallback={<div>Loading...</div>}>
<Switch>
<Route
path="/callback"
component={withTracker(CallbackConnected)}
/>
<Route
path="/"
exact
component={withTracker(LandingPageConnected)}
/>
<Route
path="/external-links"
component={withTracker(LinkoutPage)}
/>
<PrivateRoute
path="/analysis/:subjectType"
component={withTracker(AnalysisHomePageConnected)}
/>
<Route
path="/methods"
component={withTracker(MethodsConnected)}
/>
<Route path="/team" component={withTracker(TeamPage)} />
<Route path="/contact" component={withTracker(Contact)} />
<Route
path="/announcements"
component={withTracker(AnnouncementsPage)}
/>
<Route
path="/error"
component={withTracker(ErrorPageConnected)}
/>
<PrivateRoute
path="/summary"
component={withTracker(DataSummaryPageConnected)}
/>
<PrivateRoute
path="/releases"
component={withTracker(ReleasePageConnected)}
/>
<PrivateRoute
path="/qc-data-monitor"
component={withTracker(DataStatusPageConnected)}
/>
<Route
path="/data-download"
exact
component={withTracker(BrowseDataPageConnected)}
/>
<Route
path="/data-download/file-browser"
exact
component={withTracker(BrowseDataPageConnected)}
/>
<Route
path="/data-access"
component={withTracker(DataAccessPageConnected)}
/>
<Route
path="/related-studies"
exact
component={withTracker(RelatedStudy)}
/>
<Route
path="/related-studies/heritage-proteomics"
exact
component={withTracker(HeritageProteomics)}
/>
<Route
path="/search"
component={withTracker(SearchPageConnected)}
/>
<Route
path="/gene-centric"
component={withTracker(GeneCentricViewConnected)}
/>
<Route
path="/graphical-clustering"
component={withTracker(GraphicalClustering)}
/>
<Route
path="/code-repositories"
component={withTracker(CodeRepositories)}
/>
<Route
path="/project-overview"
component={withTracker(MainStudyConnected)}
/>
<Route path="/tutorials" component={withTracker(Tutorials)} />
<Route
path="/publications"
exact
component={withTracker(Publications)}
/>
<Route
path="/publications/data/animal/phenotype/full-table-endurance-training"
exact
component={withTracker(FullTableEnduranceTraining)}
/>
<Route
path="/publications/docs/protocol/clinical/study-protocols"
exact
component={withTracker(ClinicalStudyProtocols)}
/>
<PrivateRoute
path="/analysis-phenotype"
component={withTracker(Pass1b06PhenotypeAnimalConnected)}
/>
<PrivateRoute
path="/multiomics-working-groups"
component={withTracker(MultiOmicsWorkingGroups)}
/>
</Switch>
</Suspense>
<Switch>
<Route
path="/callback"
component={withTracker(CallbackConnected)}
/>
<Route
path="/"
exact
component={withTracker(LandingPageConnected)}
/>
<Route
path="/external-links"
component={withTracker(LinkoutPage)}
/>
<PrivateRoute
path="/analysis/:subjectType"
component={withTracker(AnalysisHomePageConnected)}
/>
<Route
path="/methods"
component={withTracker(MethodsConnected)}
/>
<Route path="/team" component={withTracker(TeamPage)} />
<Route path="/contact" component={withTracker(Contact)} />
<Route
path="/announcements"
component={withTracker(AnnouncementsPage)}
/>
<Route
path="/error"
component={withTracker(ErrorPageConnected)}
/>
<PrivateRoute
path="/summary"
component={withTracker(DataSummaryPageConnected)}
/>
<PrivateRoute
path="/releases"
component={withTracker(ReleasePageConnected)}
/>
<PrivateRoute
path="/qc-data-monitor"
component={withTracker(DataStatusPageConnected)}
/>
<Route
path="/data-download"
exact
component={withTracker(BrowseDataPageConnected)}
/>
<Route
path="/data-download/file-browser"
exact
component={withTracker(BrowseDataPageConnected)}
/>
<Route
path="/data-access"
component={withTracker(DataAccessPageConnected)}
/>
<Route
path="/related-studies"
exact
component={withTracker(RelatedStudy)}
/>
<Route
path="/related-studies/heritage-proteomics"
exact
component={withTracker(HeritageProteomics)}
/>
<Route
path="/search"
component={withTracker(SearchPageConnected)}
/>
<Route
path="/gene-centric"
component={withTracker(GeneCentricViewConnected)}
/>
<Route
path="/graphical-clustering"
component={withTracker(GraphicalClustering)}
/>
<Route
path="/code-repositories"
component={withTracker(CodeRepositories)}
/>
<Route
path="/project-overview"
component={withTracker(MainStudyConnected)}
/>
<Route path="/tutorials" component={withTracker(Tutorials)} />
<Route
path="/publications"
exact
component={withTracker(Publications)}
/>
<Route
path="/publications/data/animal/phenotype/full-table-endurance-training"
exact
component={withTracker(FullTableEnduranceTraining)}
/>
<Route
path="/publications/docs/protocol/clinical/study-protocols"
exact
component={withTracker(ClinicalStudyProtocols)}
/>
<PrivateRoute
path="/analysis-phenotype"
component={withTracker(Pass1b06PhenotypeAnimalConnected)}
/>
<PrivateRoute
path="/multiomics-working-groups"
component={withTracker(MultiOmicsWorkingGroups)}
/>
</Switch>
</div>
</div>
</Router>
Expand Down

0 comments on commit 7f2f879

Please sign in to comment.