Feature/mini challenge5 - from challenge 4#5
Open
wdonet wants to merge 2 commits intofeature/MiniChallenge4from
Open
Feature/mini challenge5 - from challenge 4#5wdonet wants to merge 2 commits intofeature/MiniChallenge4from
wdonet wants to merge 2 commits intofeature/MiniChallenge4from
Conversation
wdonet
commented
Apr 6, 2021
Author
wdonet
left a comment
There was a problem hiding this comment.
I left a few comments and suggestions
- All the sections have their own route.
- Navigation across the sections is implemented correctly.
- The Global State is persistent across all the sections.
- The "Mocked Authentication" mechanism works correctly.
- The "session data" is stored in the Global Context correctly.
- Videos can be added to the Favorites list.
- Videos can be removed from the Favorites list.
- Navigation to Favorite Videos View using a private route is implemented correctly (only authenticated users should access this section).
- Navigation to the Favorite Video Details View using a private route is implemented correctly (only authenticated users should access this section).
- Information for the selected favorite video is displayed correctly
- The list of other favorite videos in the Favorite Video Details View is displayed.
- Testing coverage is above 70%. (Please include a screenshot of the code coverage report in your PR description).
- Note: It is below 70
Bonus Points
- The Add/remove from favorites button should appear when the user passes the mouse over the video card in the list.
- Integrate with a real authentication provider (such as Auth0, OAuth or Firebase).
- A 404 section is shown when a route is not found.
- The Login View is implemented as a modal using React Portals.
Comment on lines
+80
to
+84
| if (index !== -1) { | ||
| setFavorite(true); | ||
| } else { | ||
| setFavorite(false); | ||
| } |
Author
There was a problem hiding this comment.
could be reduced to setFavorite()
Suggested change
| if (index !== -1) { | |
| setFavorite(true); | |
| } else { | |
| setFavorite(false); | |
| } | |
| setFavorite(index !== -1); |
| const isFavorite = () => { | ||
| if (favoritesList !== null) { | ||
| const index = favoritesList.findIndex( | ||
| (element) => element.id.videoId === video.id.videoId |
Author
There was a problem hiding this comment.
Use defaults for defense coding this case like:
Suggested change
| (element) => element.id.videoId === video.id.videoId | |
| ({ id = {}} = {}) => id.videoId === video.id.videoId |
| <p>{snippet.description}</p> | ||
| </VideoDescription> | ||
| {isLogged ? addFavorites : ''} | ||
| {isLogged ? show() : ''} |
Author
There was a problem hiding this comment.
instead to return an empty string on else case, when you want to render nothing, it is better to return null
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I added this just for checking the incremental changes from last challenge