- Replace
<your_account>
with your Github username in the DEMO LINK - Follow the React task guideline
- Rename
.tsx
files to.jsx
- use
eslint-config-react
in.eslintrs.js
- Install all the NPM packages you need and types for them.
- Implement
HomePage
available at/
with just a titleHome page
- Implement
PeoplePage
available at/people
with a titlePeope page
- Redirect to
/
from/home
- Implement
NotFoundPage
with a titlePage not found
that is shown for all the other URLs - Add a
Header
visible everywhere with navigation links to both pages - Create
getPeople
method fetchingpeople
from API whenPeoplePage
is opened- Find a
mother
and afather
bymotherName
andfatherName
and add them to the person for future use
- Find a
- Implement
PeopleTable
component accepting an array of people as a param and rendering them in a table It should show these columns:name
sex
born
died
mother
father
<PeopleTable people={people} />
<table className="PeopleTable"> <thead>...</thead> <tbody>...</tbody> </table>
- add
border-collapse: collapse
style to the table
- Implement
PersonRow
component accepting aperson
and displaying all the data described above<tr class="Person"> <td></td> ... <td></td> </tr>
- Implement
PersonName
component rendering the name as a link to a person using itsslug
property/people/carolus-haverbeke-1832
- It should be used for
name
,mother
andfather
columns - Use
blue
for men andred
women - If mother or father were not found in the array by their name show just a name (black, bold) instead of
PersonName
component
- It should be used for
- Highlight the
PersonRow
mentioned in the URL with some background-color- Highlight nobody if the
slug
in the URL is not found among the people
- Highlight nobody if the
- Add an
<input>
to filter people byname
,motherName
andfatherName
- it should update the URL with
?query=car
wherecar
is a string entered by the user - Read the
query
from the URL and set its value to the input when the page is loaded
- it should update the URL with
PeoplePage
should read thequery
from the URL and filter people accordingly- check is the
query
matches thename
,motherName
orfatherName
- check is the
- Implement the sorting by
name
,sex
,born
anddied
by clicking on the column title- Highlight the column with the *
- Add
?sortBy=born
param to the URL - Sort the people by selected column
- If the page is loaded with
sortBy
it should be applied (column is highilghted and people are sorted) - If the
sortBy
value is not valid don't highlight any column and don't sort people
- Sort should work together with filtering
- The
query
andsortBy
should stay in the URL when you select a user (keeplocation.search
on navigation) - Implement the ability to sort people in both directions
?sortOrder=asc
ordesc
- add Sort both icon to show that column allows sorting
- The first click sorts
ascending
(A-Z) the second sortsdescending
(Z-A) - add
sort_ask
orsort_desc
icons accordingly to the applied sorting
- Update the
query
in the URL withdebounce
of 500ms
- (* OPTIONAL) Create a
NewPerson
component with a form to add new people and show it above the table- all the fields should be required for now
sex
should be chosen among 2 options (radio buttons)mother
andfather
are selects with all thewomen
andmen
from the table accordingly
- (* OPTIONAL) Create an
Add person
button navigating to/people/new
- the
NewPerson
should appear instead of a button - When the person is added you should navigate back to the
/people
page
- the
- (* OPTIONAL) Add data validations:
name
should contain only letters and spacesborn
anddied
are valid years between1400
and the current yeardied
should be disabled ifborn
is emptydied - born
should be >= 0 and < 150- make
mother
andfather
field optional - update the list of
mothers
andfathers
according to the enteredborn
year (they must be alive) (selects should be empty and disabled before the born year was entered)