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 = () => {
+ 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 ( - - ); -}; diff --git a/src/components/PeopleFilters/PeopleFilters.tsx b/src/components/PeopleFilters/PeopleFilters.tsx new file mode 100644 index 000000000..06c471041 --- /dev/null +++ b/src/components/PeopleFilters/PeopleFilters.tsx @@ -0,0 +1,123 @@ +import classNames from 'classnames'; +import { useSearchParams } from 'react-router-dom'; +import { getSearchWith } from '../../utils/searchHelper'; +import { SearchLink } from '../SearchLink'; + +const centuriesButton = ['16', '17', '18', '19', '20']; + +export const PeopleFilters = () => { + const [searchParams, setSearchParams] = useSearchParams(); + + const query = searchParams.get('query') || ''; + const sex = searchParams.get('sex') || ''; + const centuries = searchParams.getAll('centuries') || []; + + const handleQueryChange = (event: React.ChangeEventSomething went wrong
- -- There are no people on the server -
- -There are no people matching the current search criteria
- -- - Name - - - - - - - | - -- - Sex - - - - - - - | - -- - Born - - - - - - - | - -- - Died - - - - - - - | - -Mother | -Father | -
---|---|---|---|---|---|
- Pieter Haverbeke - | -m | -1602 | -1642 | -- | -- - Lieven van Haverbeke - - | -
- - Anna van Hecke - - | -f | -1607 | -1670 | -Martijntken Beelaert | -Paschasius van Hecke | -
- Lieven Haverbeke - | -m | -1631 | -1676 | -- - Anna van Hecke - - | -- Pieter Haverbeke - | -
- - Elisabeth Hercke - - | -f | -1632 | -1674 | -Margriet de Brabander | -Willem Hercke | -
- Daniel Haverbeke - | -m | -1652 | -1723 | -- - Elisabeth Hercke - - | -- Lieven Haverbeke - | -
- - Joanna de Pape - - | -f | -1654 | -1723 | -Petronella Wauters | -Vincent de Pape | -
- - Martina de Pape - - | -f | -1666 | -1727 | -Petronella Wauters | -Vincent de Pape | -
- Willem Haverbeke - | -m | -1668 | -1731 | -- - Elisabeth Hercke - - | -- Lieven Haverbeke - | -
- Jan Haverbeke - | -m | -1671 | -1731 | -- - Elisabeth Hercke - - | -- Lieven Haverbeke - | -
- - Maria de Rycke - - | -f | -1683 | -1724 | -Laurentia van Vlaenderen | -Frederik de Rycke | -
- - Livina Haverbeke - - | -f | -1692 | -1743 | -- - Joanna de Pape - - | -- Daniel Haverbeke - | -
- - Pieter Bernard Haverbeke - - | -m | -1695 | -1762 | -Petronella Wauters | -- Willem Haverbeke - | -
- - Lieven de Causmaecker - - | -m | -1696 | -1724 | -Joanna Claes | -Carel de Causmaecker | -
- - Jacoba Lammens - - | -f | -1699 | -1740 | -Livina de Vrieze | -Lieven Lammens | -
- Pieter de Decker - | -m | -1705 | -1780 | -Petronella van de Steene | -Joos de Decker | -
- - Laurentia Haverbeke - - | -f | -1710 | -1786 | -- - Maria de Rycke - - | -- Jan Haverbeke - | -
- - Elisabeth Haverbeke - - | -f | -1711 | -1754 | -- - Maria de Rycke - - | -- Jan Haverbeke - | -
- Jan van Brussel - | -m | -1714 | -1748 | -Joanna van Rooten | -Jacobus van Brussel | -
- - Bernardus de Causmaecker - - | -m | -1721 | -1789 | -- - Livina Haverbeke - - | -- - Lieven de Causmaecker - - | -
- - Jan Francies Haverbeke - - | -m | -1725 | -1779 | -Livina de Vrieze | -- - Pieter Bernard Haverbeke - - | -
- - Angela Haverbeke - - | -f | -1728 | -1734 | -Livina de Vrieze | -- - Pieter Bernard Haverbeke - - | -
- - Petronella de Decker - - | -f | -1731 | -1781 | -- - Livina Haverbeke - - | -- Pieter de Decker - | -
- - Jacobus Bernardus van Brussel - - | -m | -1736 | -1809 | -- - Elisabeth Haverbeke - - | -- Jan van Brussel - | -
- - Pieter Antone Haverbeke - - | -m | -1753 | -1798 | -- - Petronella de Decker - - | -- - Jan Francies Haverbeke - - | -
- - Jan Frans van Brussel - - | -m | -1761 | -1833 | -- | -- - Jacobus Bernardus van Brussel - - | -
- - Livina Sierens - - | -f | -1761 | -1826 | -Maria van Waes | -Jan Sierens | -
- - Joanna de Causmaecker - - | -f | -1762 | -1807 | -- | -- - Bernardus de Causmaecker - - | -
- Carel Haverbeke - | -m | -1796 | -1837 | -- - Livina Sierens - - | -- - Pieter Antone Haverbeke - - | -
- - Maria van Brussel - - | -f | -1801 | -1834 | -- - Joanna de Causmaecker - - | -- - Jan Frans van Brussel - - | -
- Carolus Haverbeke - | -m | -1832 | -1905 | -- - Maria van Brussel - - | -- Carel Haverbeke - | -
- - Maria Sturm - - | -f | -1835 | -1917 | -Seraphina Spelier | -Charles Sturm | -
- - Emma de Milliano - - | -f | -1876 | -1956 | -Sophia van Damme | -Petrus de Milliano | -
- Emile Haverbeke - | -m | -1877 | -1968 | -- - Maria Sturm - - | -- Carolus Haverbeke - | -
No results for your search
+ ); + } + + return ( +
+
+ {field[0].toUpperCase() + field.slice(1)}
+ |
+ ))}
+
+ Mother | +Father | +|||
---|---|---|---|---|---|
+ person.slug === slug} + className={classNames({ + 'has-text-danger': person.sex === 'f', + })} + > + {person.name} + + | + +{person.sex} | +{person.born} | +{person.died} | +
+ {
+ person.mother?.slug ? (
+ slug === person.mother?.slug}
+ >
+ {person.mother?.name}
+
+ ) : (
+ {person.motherName ? person.motherName : '-'} + ) + } + + |
+
+ {
+ person.father?.slug ? (
+ slug === person.father?.slug}
+ >
+ {person.fatherName ? person.fatherName : '-'}
+
+ ) : (
+ {person.fatherName ? person.fatherName : '-'} + ) + } + |
+