Skip to content

Conversation

@JaviHuizar
Copy link

No description provided.

Copy link

@erickwize erickwize left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
`;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend extracting all the CSS logic to a different file so we have consistency and separation of responsabilites.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants