- Replace
<your_account>with your Github username in the DEMO LINK - Follow the React task guideline
- Rename
.tsxfiles to.jsx - use
eslint-config-reactin.eslintrs.js
- Install all the NPM packages you need and types for them.
- Implement
HomePageavailable at/with just a titleHome page - Implement
PeoplePageavailable at/peoplewith a titlePeope page - Redirect to
/from/home - Implement
NotFoundPagewith a titlePage not foundthat is shown for all the other URLs - Add a
Headervisible everywhere with navigation links to both pages - Create
getPeoplemethod fetchingpeoplefrom API whenPeoplePageis opened- Find a
motherand afatherbymotherNameandfatherNameand add them to the person for future use
- Find a
- Implement
PeopleTablecomponent accepting an array of people as a param and rendering them in a table It should show these columns:namesexborndiedmotherfather<PeopleTable people={people} />
<table className="PeopleTable"> <thead>...</thead> <tbody>...</tbody> </table>
- add
border-collapse: collapsestyle to the table
- Implement
PersonRowcomponent accepting apersonand displaying all the data described above<tr class="Person"> <td></td> ... <td></td> </tr>
- Implement
PersonNamecomponent rendering the name as a link to a person using itsslugproperty/people/carolus-haverbeke-1832- It should be used for
name,motherandfathercolumns - Use
bluefor men andredwomen - If mother or father were not found in the array by their name show just a name (black, bold) instead of
PersonNamecomponent
- It should be used for
- Highlight the
PersonRowmentioned in the URL with some background-color- Highlight nobody if the
slugin the URL is not found among the people
- Highlight nobody if the
- Add an
<input>to filter people byname,motherNameandfatherName- it should update the URL with
?query=carwherecaris a string entered by the user - Read the
queryfrom the URL and set its value to the input when the page is loaded
- it should update the URL with
PeoplePageshould read thequeryfrom the URL and filter people accordingly- check is the
querymatches thename,motherNameorfatherName
- check is the
- Implement the sorting by
name,sex,bornanddiedby clicking on the column title- Highlight the column with the *
- Add
?sortBy=bornparam to the URL - Sort the people by selected column
- If the page is loaded with
sortByit should be applied (column is highilghted and people are sorted) - If the
sortByvalue is not valid don't highlight any column and don't sort people
- Sort should work together with filtering
- The
queryandsortByshould stay in the URL when you select a user (keeplocation.searchon navigation) - Implement the ability to sort people in both directions
?sortOrder=ascordesc- add Sort both icon to show that column allows sorting
- The first click sorts
ascending(A-Z) the second sortsdescending(Z-A) - add
sort_askorsort_descicons accordingly to the applied sorting
- Update the
queryin the URL withdebounceof 500ms
- (* OPTIONAL) Create a
NewPersoncomponent with a form to add new people and show it above the table- all the fields should be required for now
sexshould be chosen among 2 options (radio buttons)motherandfatherare selects with all thewomenandmenfrom the table accordingly
- (* OPTIONAL) Create an
Add personbutton navigating to/people/new- the
NewPersonshould appear instead of a button - When the person is added you should navigate back to the
/peoplepage
- the
- (* OPTIONAL) Add data validations:
nameshould contain only letters and spacesbornanddiedare valid years between1400and the current yeardiedshould be disabled ifbornis emptydied - bornshould be >= 0 and < 150- make
motherandfatherfield optional - update the list of
mothersandfathersaccording to the enteredbornyear (they must be alive) (selects should be empty and disabled before the born year was entered)