diff --git a/src/App.tsx b/src/App.tsx index adcb8594e..073d6536c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,8 @@ -import { PeoplePage } from './components/PeoplePage'; +import { Navigate, Route, Routes } from 'react-router-dom'; +import { PeoplePage } from './pages/PeoplePage'; import { Navbar } from './components/Navbar'; +import { HomePage } from './pages/HomePage'; +import { ErrorPage } from './pages/ErrorPage'; import './App.scss'; @@ -10,9 +13,15 @@ export const App = () => {
-

Home Page

-

Page not found

- + + } /> + } /> + + } /> + } /> + + } /> +
diff --git a/src/components/ErrorLoading.tsx b/src/components/ErrorLoading.tsx new file mode 100644 index 000000000..06e527d7a --- /dev/null +++ b/src/components/ErrorLoading.tsx @@ -0,0 +1,5 @@ +export const ErrorLoading: React.FC = () => ( +

+ Something went wrong +

+); diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx deleted file mode 100644 index c2aa20f1c..000000000 --- a/src/components/Navbar.tsx +++ /dev/null @@ -1,24 +0,0 @@ -export const Navbar = () => { - return ( - - ); -}; diff --git a/src/components/Navbar/Navbar.tsx b/src/components/Navbar/Navbar.tsx new file mode 100644 index 000000000..342d3a7a9 --- /dev/null +++ b/src/components/Navbar/Navbar.tsx @@ -0,0 +1,24 @@ +import classNames from 'classnames'; +import { NavLink } from 'react-router-dom'; + +export const Navbar = () => { + const handleClassName = ({ isActive }: { isActive: boolean }) => classNames( + 'navbar-item', { 'has-background-grey-lighter': isActive }, + ); + + return ( + + ); +}; diff --git a/src/components/Navbar/index.ts b/src/components/Navbar/index.ts new file mode 100644 index 000000000..e8a656233 --- /dev/null +++ b/src/components/Navbar/index.ts @@ -0,0 +1 @@ +export * from './Navbar'; diff --git a/src/components/NoPeople.tsx b/src/components/NoPeople.tsx new file mode 100644 index 000000000..ad79ad0d5 --- /dev/null +++ b/src/components/NoPeople.tsx @@ -0,0 +1,5 @@ +export const NoPeople: React.FC = () => ( +

+ There are no people on the server +

+); diff --git a/src/components/PeopleFilters.tsx b/src/components/PeopleFilters.tsx deleted file mode 100644 index 2f1608bef..000000000 --- a/src/components/PeopleFilters.tsx +++ /dev/null @@ -1,93 +0,0 @@ -export const PeopleFilters = () => { - return ( -