@@ -2,7 +2,8 @@ import { Toaster } from "@/components/ui/toaster";
22import { Toaster as Sonner } from "@/components/ui/sonner" ;
33import { TooltipProvider } from "@/components/ui/tooltip" ;
44import { QueryClient , QueryClientProvider } from "@tanstack/react-query" ;
5- import { BrowserRouter , Routes , Route } from "react-router-dom" ;
5+ import { lazy , Suspense } from "react" ;
6+ import { BrowserRouter , Routes , Route , useLocation } from "react-router-dom" ;
67import Navigation from "./components/Navigation" ;
78import Footer from "./components/Footer" ;
89import Home from "./pages/Home" ;
@@ -12,30 +13,102 @@ import Collaborations from "./pages/Collaborations";
1213import Officers from "./pages/Officers" ;
1314import SignUp from "./pages/SignUp" ;
1415import NotFound from "./pages/NotFound" ;
16+ import {
17+ ConceptFrame ,
18+ ConceptReviewHome ,
19+ } from "./concepts/ConceptReview" ;
20+
21+ const ResearchEditorial = lazy (
22+ ( ) => import ( "./concepts/research-editorial/ResearchEditorial" ) ,
23+ ) ;
24+ const LabNotebook = lazy (
25+ ( ) => import ( "./concepts/lab-notebook/LabNotebook" ) ,
26+ ) ;
27+ const BioNetwork = lazy (
28+ ( ) => import ( "./concepts/bio-network/BioNetwork" ) ,
29+ ) ;
1530
1631const queryClient = new QueryClient ( ) ;
1732
33+ const StandardSite = ( ) => (
34+ < div className = "flex flex-col min-h-screen" >
35+ < Navigation />
36+ < main className = "flex-1" >
37+ < Routes >
38+ < Route path = "/" element = { < Home /> } />
39+ < Route path = "/about" element = { < About /> } />
40+ < Route path = "/calendar" element = { < Calendar /> } />
41+ < Route path = "/collaborations" element = { < Collaborations /> } />
42+ < Route path = "/officers" element = { < Officers /> } />
43+ < Route path = "/signup" element = { < SignUp /> } />
44+ < Route path = "*" element = { < NotFound /> } />
45+ </ Routes >
46+ </ main >
47+ < Footer />
48+ </ div >
49+ ) ;
50+
51+ const ConceptLoading = ( ) => (
52+ < div className = "concept-loading" role = "status" aria-live = "polite" >
53+ < div className = "concept-loading-line concept-loading-line-wide" />
54+ < div className = "concept-loading-line" />
55+ < span > Loading design direction</ span >
56+ </ div >
57+ ) ;
58+
59+ const ConceptSite = ( ) => (
60+ < Routes >
61+ < Route path = "/concepts" element = { < ConceptReviewHome /> } />
62+ < Route
63+ path = "/concepts/research-editorial"
64+ element = {
65+ < ConceptFrame activeId = "research-editorial" >
66+ < Suspense fallback = { < ConceptLoading /> } >
67+ < ResearchEditorial />
68+ </ Suspense >
69+ </ ConceptFrame >
70+ }
71+ />
72+ < Route
73+ path = "/concepts/lab-notebook"
74+ element = {
75+ < ConceptFrame activeId = "lab-notebook" >
76+ < Suspense fallback = { < ConceptLoading /> } >
77+ < LabNotebook />
78+ </ Suspense >
79+ </ ConceptFrame >
80+ }
81+ />
82+ < Route
83+ path = "/concepts/bio-network"
84+ element = {
85+ < ConceptFrame activeId = "bio-network" >
86+ < Suspense fallback = { < ConceptLoading /> } >
87+ < BioNetwork />
88+ </ Suspense >
89+ </ ConceptFrame >
90+ }
91+ />
92+ < Route path = "*" element = { < ConceptReviewHome /> } />
93+ </ Routes >
94+ ) ;
95+
96+ const AppRoutes = ( ) => {
97+ const location = useLocation ( ) ;
98+ return location . pathname . startsWith ( "/concepts" ) ? (
99+ < ConceptSite />
100+ ) : (
101+ < StandardSite />
102+ ) ;
103+ } ;
104+
18105const App = ( ) => (
19106 < QueryClientProvider client = { queryClient } >
20107 < TooltipProvider >
21108 < Toaster />
22109 < Sonner />
23110 < BrowserRouter >
24- < div className = "flex flex-col min-h-screen" >
25- < Navigation />
26- < main className = "flex-1" >
27- < Routes >
28- < Route path = "/" element = { < Home /> } />
29- < Route path = "/about" element = { < About /> } />
30- < Route path = "/calendar" element = { < Calendar /> } />
31- < Route path = "/collaborations" element = { < Collaborations /> } />
32- < Route path = "/officers" element = { < Officers /> } />
33- < Route path = "/signup" element = { < SignUp /> } />
34- < Route path = "*" element = { < NotFound /> } />
35- </ Routes >
36- </ main >
37- < Footer />
38- </ div >
111+ < AppRoutes />
39112 </ BrowserRouter >
40113 </ TooltipProvider >
41114 </ QueryClientProvider >
0 commit comments