initial
This commit is contained in:
46
src/App.jsx
46
src/App.jsx
@@ -1,23 +1,41 @@
|
||||
import { BrowserRouter, Routes, Route } from 'react-router-dom'
|
||||
import { lazy, Suspense } from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import Layout from './components/Layout'
|
||||
import Home from './pages/Home'
|
||||
import About from './pages/About'
|
||||
import Services from './pages/Services'
|
||||
import Project from './pages/Project'
|
||||
import Contact from './pages/Contact'
|
||||
|
||||
const Home = lazy(() => import('./pages/Home'))
|
||||
const About = lazy(() => import('./pages/About'))
|
||||
const Services = lazy(() => import('./pages/Services'))
|
||||
const ServiceDetail = lazy(() => import('./pages/ServiceDetail'))
|
||||
const Project = lazy(() => import('./pages/Project'))
|
||||
const Contact = lazy(() => import('./pages/Contact'))
|
||||
|
||||
function NotFound() {
|
||||
return (
|
||||
<div style={{ padding: '120px 24px', textAlign: 'center' }}>
|
||||
<h1>404 — Page Not Found</h1>
|
||||
<p>The page you're looking for doesn't exist.</p>
|
||||
<Link to="/" style={{ color: '#FA2D39' }}>← Back to Home</Link>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<BrowserRouter>
|
||||
<Routes>
|
||||
<Route element={<Layout />}>
|
||||
<Route path="/" element={<Home />} />
|
||||
<Route path="/about" element={<About />} />
|
||||
<Route path="/service" element={<Services />} />
|
||||
<Route path="/project" element={<Project />} />
|
||||
<Route path="/contact" element={<Contact />} />
|
||||
</Route>
|
||||
</Routes>
|
||||
<Suspense fallback={null}>
|
||||
<Routes>
|
||||
<Route element={<Layout />}>
|
||||
<Route path="/" element={<Home />} />
|
||||
<Route path="/about" element={<About />} />
|
||||
<Route path="/service" element={<Services />} />
|
||||
<Route path="/service/:slug" element={<ServiceDetail />} />
|
||||
<Route path="/project" element={<Project />} />
|
||||
<Route path="/contact" element={<Contact />} />
|
||||
<Route path="*" element={<NotFound />} />
|
||||
</Route>
|
||||
</Routes>
|
||||
</Suspense>
|
||||
</BrowserRouter>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user