diff --git a/src/App.tsx b/src/App.tsx index 56ffc48d6..cd386837a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,31 +1,47 @@ -import { HashRouter, Route } from 'react-router-dom'; +import { Navigate, Route, Routes } from 'react-router-dom'; + import { PeoplePage } from './components/PeoplePage'; import { Navbar } from './components/Navbar'; import './App.scss'; export const App = () => { return ( - -
- -
-
- -
-
+
+ + +
+
+ + } /> + Home Page} + /> + + -
-
- - -

Home Page

-
- -

Page not found

+ )} + /> + + )} + /> -
+ + Page not found + + )} + /> +
-
- + +
); }; diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 74e30faa7..bab39959b 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -1,34 +1,35 @@ -import { useState } from 'react'; -import { Link } from 'react-router-dom'; +import classNames from 'classnames'; +import { NavLink, useSearchParams } from 'react-router-dom'; + +type Active = { + isActive: boolean +}; export const Navbar = () => { - const [activePage, setActivePage] = useState('home'); + const [searchParams] = useSearchParams(); + + const linkClass = (active: Active) => classNames('navbar-item', { + 'has-background-grey-lighter': active.isActive, + }); + const peopleLink = `people?${searchParams.toString()}`; return ( -