@@ -2,7 +2,6 @@ import { useEffect } from 'react';
22import { HashRouter as Router , Routes , Route , Navigate , useLocation } from 'react-router-dom' ;
33import { Navigation } from './components/Navigation' ;
44import { Footer } from './components/Footer' ;
5- import { LoadingScreen } from './components/LoadingScreen' ;
65import { Home } from './components/pages/Home' ;
76import { About } from './components/pages/About' ;
87import { Experience } from './components/pages/Experience' ;
@@ -17,13 +16,11 @@ import { Contact } from './components/pages/Contact';
1716import { Photography } from './components/pages/Photography' ;
1817import { CMS } from './components/pages/CMS' ;
1918import { preloadCriticalImages } from './utils/preloadImages' ;
20- import { useImageLoading } from './hooks/useImageLoading' ;
2119import './utils/navHeight' ;
2220
2321function AppContent ( ) {
2422 const location = useLocation ( ) ;
2523 const isHomePage = location . pathname === '/' || location . pathname === '/#/' ;
26- const isLoading = useImageLoading ( ) ;
2724
2825 // Scroll to top when opening About, Stories, Projects, etc. so the top nav "moves up" into view
2926 useEffect ( ( ) => {
@@ -44,44 +41,39 @@ function AppContent() {
4441 } ;
4542 } , [ ] ) ;
4643
47- // Preload critical images on app mount (for additional optimization)
44+ // Preload critical images on app mount
4845 useEffect ( ( ) => {
49- if ( ! isLoading ) {
50- preloadCriticalImages ( ) ;
51- }
52- } , [ isLoading ] ) ;
46+ preloadCriticalImages ( ) ;
47+ } , [ ] ) ;
5348
5449 return (
55- < >
56- < LoadingScreen isLoading = { isLoading } />
57- < div className = "min-h-screen bg-background flex flex-col" >
58- { ! isHomePage && < Navigation /> }
59- < main className = "flex-1" >
60- < Routes >
61- < Route path = "/" element = {
62- < div className = "min-h-screen flex flex-col items-center justify-center bg-background" >
63- < Home />
64- </ div >
65- } />
66- < Route path = "/about" element = { < About /> } />
67- < Route path = "/experience" element = { < Experience /> } />
68- < Route path = "/projects" element = { < Projects /> } />
69- < Route path = "/projects/:projectId" element = { < ProjectDetail /> } />
70- < Route path = "/impact" element = { < Impact /> } />
71- < Route path = "/impact/:storyId" element = { < StoryDetail /> } />
72- < Route path = "/storiesofadventure" element = { < StoriesOfAdventure /> } />
73- < Route path = "/storiesofadventure/:storyId" element = { < StoryOfAdventureDetail /> } />
74- < Route path = "/accessibility" element = { < Accessibility /> } />
75- < Route path = "/contact" element = { < Contact /> } />
76- < Route path = "/photography" element = { < Photography /> } />
77- < Route path = "/cms" element = { < CMS /> } />
78- < Route path = "/CMS" element = { < Navigate to = "/cms" replace /> } />
79- < Route path = "*" element = { < Navigate to = "/" replace /> } />
80- </ Routes >
81- </ main >
82- { ! isHomePage && < Footer /> }
83- </ div >
84- </ >
50+ < div className = "min-h-screen bg-background flex flex-col" >
51+ { ! isHomePage && < Navigation /> }
52+ < main className = "flex-1" >
53+ < Routes >
54+ < Route path = "/" element = {
55+ < div className = "min-h-screen flex flex-col items-center justify-center bg-background" >
56+ < Home />
57+ </ div >
58+ } />
59+ < Route path = "/about" element = { < About /> } />
60+ < Route path = "/experience" element = { < Experience /> } />
61+ < Route path = "/projects" element = { < Projects /> } />
62+ < Route path = "/projects/:projectId" element = { < ProjectDetail /> } />
63+ < Route path = "/impact" element = { < Impact /> } />
64+ < Route path = "/impact/:storyId" element = { < StoryDetail /> } />
65+ < Route path = "/storiesofadventure" element = { < StoriesOfAdventure /> } />
66+ < Route path = "/storiesofadventure/:storyId" element = { < StoryOfAdventureDetail /> } />
67+ < Route path = "/accessibility" element = { < Accessibility /> } />
68+ < Route path = "/contact" element = { < Contact /> } />
69+ < Route path = "/photography" element = { < Photography /> } />
70+ < Route path = "/cms" element = { < CMS /> } />
71+ < Route path = "/CMS" element = { < Navigate to = "/cms" replace /> } />
72+ < Route path = "*" element = { < Navigate to = "/" replace /> } />
73+ </ Routes >
74+ </ main >
75+ { ! isHomePage && < Footer /> }
76+ </ div >
8577 ) ;
8678}
8779
0 commit comments