Assignments > HW6: React Client
Due on Wed, 03/29 @ 11:59PM. 40 Points.
Overview
In this homework assignment, you will re-implement your HW4 & HW5 code in React. I recommend that you build from the code you started in Tutorial 8, but that’s not required. I won’t be grading you on CSS, but please do make it look nice. You’re also welcome to customize the look and feel to make it your own.
When you’re done, your React version of the PhotoApp should behave like this one: https://photo-app-secured.herokuapp.com/.
Tasks
In the section below, I’ve mapped out a suggested implementation strategy. If you implement your React functionality differently, that’s fine, but I will be verifying that you did indeed make a series of components (versus just copying your HW4-5 file into a React folder and only making minor changes).
Points | Component / Task | Description |
---|---|---|
2pts |
NavBar.js Displays the Header |
(Already done for you) Create a NavLinks component that displays the username of the logged in user, a logout button, and a link to the API tester as shown in the demo. Notes:
|
2pts |
Profile.js Display Profile |
Create a Profile component that displays the current user's profile (inside of the right panel) using data from the /api/profile endpoint.
|
2pts |
Stories.js Display Stories |
Create a Stories component that displays stories from the user's network. This component will both fetch the stories from /api/stories , and draw the stories.
|
2pts |
Suggestions.js Display All Suggestions |
Create a Suggestions component that displays suggested user accounts. This component will both fetch the suggestions from /api/suggestions , and draw the suggested users with the help of the Suggestion.js child component (see below).
|
5pts |
Suggestion.js Display Individual Suggestion |
Create a Suggestion component that will:
|
2pts |
Posts.js Display All Posts |
Create a Posts component that displays all of the posts user accounts. This component will both fetch the posts from /api/posts , and draw each post users with the help of the Post.js child component (see below).
|
3pts |
Post.js Display Individual Post |
Create a Post component so that it looks like the post from HW4. To do this:
|
2pts |
Post.js Fetch and Redraw Post |
Within your Post component, you will also have to write some code to redraw a post after its structure is modified (liked/unliked, bookmarked/unbookmarked, etc.). We recommend that you create a function called requeryPost that:
LikeButton , BookmarkButton , etc.) by passing a reference to this function as a property. This way, the child components can also trigger a post redraw by invoking its parent's requeryPost function.
|
4pts |
LikeButton.js Like / Unlike Post |
Create a LikeButton component that will:
|
4pts |
BookmarkButton.js Bookmark / Un-Bookmark Post |
Create a BookmarkButton component that will:
|
5pts |
AddComment.js Add a Comment |
Create an AddComment component that will:
|
1pt | Keyboard Navigation |
|
2pts | Aria attributes |
Use the "aria-label" and "aria-checked" attributes (in conjunction with the role="switch" attribute) to indicate to the screen reader whether the following buttons are turned on or off:
|
4pts |
Form Accessibility Extra handling for "Add Comment" |
|
What to Turn In
Please review the requirements above and ensure you have met them. When you’re done, please submit a zip file that includes the following files:
- Your code (please exclude the
node_modules
andbuild
directories) - If you worked with a partner, name them here.
Note: We will eventually be deploying your React App to the cloud, but there are a few other steps that are necessary to “teach” GitHub how to issue the appropriate Node.js build processes. We will tackle this later in the semester.