In this lab you will add routing to an animal hospital's website using React Router.
-
Fork and clone this repository.
-
Navigate to the cloned repository's directory on your command line. Then, run the following command:
npm installThis will install the libraries needed.
-
Open up the repository in VSCode. Follow the instructions below to complete the Lab.
-
Deploy this application to Netlify and add the link to your netlify site below:
The general functionality of the page already exists. Unfortunately, the contents of three different pages are all dumped on the main page!
You will need to add routing for the page. To complete this lab, you will need to create the following routes:
/: When going to the index, you should see theHomecomponent, alongside theNavandFooter./staff: When going to the Staff page route, you should see theStaffListcomponent, alongside theNavandFooter./pets: When going to the Pets page route, you should be redirected to/pets/cats./pets/cats: When going to the Cats page route, you should see thePetsListcomponent, alongside theNavandFooter. You should only be shown cats./pets/dogs: When going to the Dogs page route, you should see thePetsListcomponent, alongside theNavandFooter. You should only be shown dogs.
Additionally, the following links and buttons should have some effects.
- The
Navcontains three links. Update the links so that they work with React router.Northwest Animal Hospital- should link to/All Staff- should link to/staffAll Pets- should link to/pets
- The
PetsListcontains two links: "See All Cats" and "See All Dogs". Clicking either link should send the person to the appropriate route and change the displayed list.
By doing the above, all of the tests should pass as opposed to just a few.
There are no API calls in this Lab. This is so that you can focus on routing as opposed to networking.
All of the data is contained inside of the src/data folder and is imported inside of App.js.
/staff
/cats
/dogs
The following tips may help you as you're working on this project:
- Remember that you will need to import React Router-specific elements by importing from
"react-router-dom". - Remember that
aelements should not be used with React Router. Instead, useLinkcomponents. - The
/petspage allows for a nested view. The sidebar with the links to see all cats and dogs should remain on the page while the inner piece of the page should change depending on the route.
-
Work on styling
- Create a sticky footer: No matter the height of the rest of the elements the footer is always, at minimum, at the bottom or below.
- Make the pages responsive
-
Make a 404 page
- if someone goes to
/pets/birdsit goes to a customNot Foundview
- if someone goes to
-
Create a new page
New Pet- that has a form that will allow you to add a new pet and see it appear in one of the lists -
Create a new pagew
New Staffthat has a form that will allow you to add a new staff memeber and see it appear in the staff list -
Make pages and views for owners (look at the
datain thedatafolder in/src) -
Allow sorting of dog/cats by name or breed



