Here is the working example
Implement the App
with 2 pages and ability to select a person in the table.
- Create the
HomePage
available at/
with just a titleHome Page
- Create the
PeoplePage
available at/people
with a titlePeople Page
- Use Navigate component to redirect from
/home
to/
;- add
replace
attribute not to save/home
URL in the browser history and avoid navigation loop when you press browserGo back
button.
- add
- Implement
NotFoundPage
with a titlePage not found
that is shown for all the other URLs; - Add the
Navbar
with 2 linksHome
andPeople
. Active one should have thehas-background-grey-lighter
class; - Use
HashRouter
to be able to share a link to any page on Github pages; - Fetch
people
from the API whenPeoplePage
is opened; - Pass
people
toPeopleTable
component and render as a table (see the given markup); - Make each name in the table a link a to
/people/:slug
(including mother and father)- create the
<PersonLink person={person} />
and use it for all existing people; - add the
has-text-danger
class for women names; - if there is no person with a given name among the people just keep the name as a text (not a link);
- if the motherName or fatherName is empty put
-
to the table
- create the
- Highlight the row of the selected person with the
has-background-warning
class;
- Implement a solution following the React task guideline.
- Use the React TypeScript cheat sheet.
- Open one more terminal and run tests with
npm test
to ensure your solution is correct. - Replace
<your_account>
with your Github username in the DEMO LINK and add it to the PR description.