diff --git a/src/App.jsx b/src/App.jsx index edf5744..9d71edf 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,11 +1,13 @@ import { Outlet } from 'react-router-dom' import Header from './components/layout/Header.jsx' import Footer from './components/layout/Footer.jsx' +import ScrollToTop from './components/ScrollToTop.jsx' import './index.css' function App() { return (
+
diff --git a/src/components/ScrollToTop.jsx b/src/components/ScrollToTop.jsx new file mode 100644 index 0000000..7990ed8 --- /dev/null +++ b/src/components/ScrollToTop.jsx @@ -0,0 +1,10 @@ +import { useEffect } from 'react' +import { useLocation } from 'react-router-dom' + +export default function ScrollToTop() { + const { pathname } = useLocation() + useEffect(() => { + window.scrollTo(0, 0) + }, [pathname]) + return null +} diff --git a/src/components/layout/Header.jsx b/src/components/layout/Header.jsx index f81ebe6..822d294 100644 --- a/src/components/layout/Header.jsx +++ b/src/components/layout/Header.jsx @@ -77,7 +77,7 @@ const Header = () => { {/* CTA Button */}
- + Request Consultation
@@ -146,7 +146,7 @@ const Header = () => {
- + Request Consultation
diff --git a/src/pages/NotFound.jsx b/src/pages/NotFound.jsx new file mode 100644 index 0000000..eb8ed4e --- /dev/null +++ b/src/pages/NotFound.jsx @@ -0,0 +1,27 @@ +import { Helmet } from 'react-helmet-async' +import { Link } from 'react-router-dom' + +export default function NotFound() { + return ( + <> + + Page Not Found | Queue North Technologies + + +
+
+

404

+

The page you're looking for doesn't exist.

+
+ + Back to Home + + + Contact Us + +
+
+
+ + ) +} diff --git a/src/router.jsx b/src/router.jsx index aba5e2a..fac6072 100644 --- a/src/router.jsx +++ b/src/router.jsx @@ -8,11 +8,14 @@ import Industries from './pages/Industries.jsx' import IndustryDetail from './pages/IndustryDetail.jsx' import Contact from './pages/Contact.jsx' import Support from './pages/Support.jsx' +import NotFound from './pages/NotFound.jsx' const router = createBrowserRouter([ { path: '/', - element: , + element: ( + + ), children: [ { index: true, element: }, { path: 'about', element: }, @@ -22,6 +25,7 @@ const router = createBrowserRouter([ { path: 'industries/:slug', element: }, { path: 'contact', element: }, { path: 'support', element: }, + { path: '*', element: }, ], }, ])