forked from realstoman/react-tailwindcss-portfolio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
45 lines (40 loc) · 1.35 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { AnimatePresence } from 'framer-motion';
import { lazy, Suspense } from 'react';
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
import ScrollToTop from './components/ScrollToTop';
import AppFooter from './components/shared/AppFooter';
import AppHeader from './components/shared/AppHeader';
import './css/App.css';
import UseScrollToTop from './hooks/useScrollToTop';
const About = lazy(() => import('./pages/AboutMe'));
const Contact = lazy(() => import('./pages/Contact.jsx'));
const Home = lazy(() => import('./pages/Home'));
const Projects = lazy(() => import('./pages/Projects'));
const ProjectSingle = lazy(() => import('./pages/ProjectSingle.jsx'));
function App() {
return (
<AnimatePresence>
<div className=" bg-secondary-light dark:bg-primary-dark transition duration-300">
<Router>
<ScrollToTop />
<AppHeader />
<Suspense fallback={""}>
<Routes>
<Route path="/" element={<Home />} />
<Route path="projects" element={<Projects />} />
<Route
path="projects/single-project"
element={<ProjectSingle />}
/>
<Route path="about" element={<About />} />
<Route path="contact" element={<Contact />} />
</Routes>
</Suspense>
<AppFooter />
</Router>
<UseScrollToTop />
</div>
</AnimatePresence>
);
}
export default App;