Open
Conversation
erickwize
reviewed
Mar 23, 2021
erickwize
left a comment
There was a problem hiding this comment.
Comments:
Good job Javier! I see it is working but sometimes crashes when the snippet is undefined. I also see you use npm and yarn to install dependencies (not a good practice). I gave some recommendations but the code looks good.
Acceptance Criteria
- Videos in the Home View are fetched from the YouTube API and displayed correctly.
- Users can search for YouTube videos using the search field on the header.
- A video can be played from the Video Details View after clicking on it.
- The video information and related videos list are displayed correctly on the Video Details View.
- When a user clicks on a related video the video player, information and related videos list are updated.
Bonus Points
- Custom Hooks for API calls are implemented and tested correctly.
- Testing coverage is above 60%. (Please include a screenshot of the code coverage report in your PR description).
| @@ -0,0 +1,12 @@ | |||
| import axios from 'axios'; | |||
|
|
|||
| const KEY = 'AIzaSyAKlMA9FgSpXSkjxhs69n6zsBOPhcHtiKA'; | |||
There was a problem hiding this comment.
I highly recommend hiding this key on .env file
Comment on lines
+13
to
+22
| const renderedVideos = videos.map((video) => { | ||
| return ( | ||
| <VideoCard | ||
| key={Math.random()} | ||
| video={video} | ||
| handleVideoSelected={handleVideoSelected} | ||
| /> | ||
| ); | ||
| }); | ||
| return <VideoListContainer>{renderedVideos}</VideoListContainer>; |
There was a problem hiding this comment.
It is common to see the map usage inside the component without creating a variable with it.
i.e.
return (
<VideoListContainer>
{videos.map(...
)}
</VideoListContainer>
Comment on lines
+7
to
+27
| const HomeBody = styled.div` | ||
| background-color: #1a243b; | ||
| text-align: center; | ||
| display: flex; | ||
| `; | ||
| const VideoRelatedWrap = styled.div` | ||
| text-align: center; | ||
| flex: 3; | ||
| margin-top: 100px; | ||
| `; | ||
| const H4 = styled.h4` | ||
| color: #b9b1b1; | ||
| `; | ||
| const VideoListWrap = styled.div` | ||
| text-align: center; | ||
| flex: 4; | ||
| `; | ||
| const VideoDetailWrap = styled.div` | ||
| text-align: center; | ||
| flex: 5; | ||
| `; |
There was a problem hiding this comment.
I recommend extracting all the CSS logic to a different file so we have consistency and separation of responsabilites.
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.
No description provided.