Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: react certification deliverable estefi #2

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

estefijacobo
Copy link

@estefijacobo estefijacobo commented Sep 29, 2020

Link to app deployed: https://gracious-heyrovsky-f2f814.netlify.app/

###Features accomplished

  • Fetch videos from Youtube API according to search word input by user.
  • Menu with Routes.
  • Access to Video Detail whenever clicking on a specific video.
  • Like a video and add it to Favorites tab.
  • Styles using styled components
  • Log in
  • Making Favorites page private
  • Import SVG correctly to like button
  • Some tests

###Features missing

  • List of related videos inside Detail page.
  • Empty states

Copy link

@victorparamo victorparamo left a comment

Choose a reason for hiding this comment

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

The code is looking good, I just added some suggestions. Also I just noticed that you are using css for the styles. I think that you should include Styled Components in the project.

case 'SET_CURRENT_VIDEO':
return { ...state, currentVideo: action.payload };
case 'ADD_FAVORITE_VIDEO': {
const videoExists = () => {

Choose a reason for hiding this comment

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

You don't need to declare these functions inside the case, you can extract them and leave the case cleaner.

favoriteVideos: state.favoriteVideos,
};
}
localStorage.setItem(

Choose a reason for hiding this comment

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

I think that is better if inside the component that is updating the state you update the local storage, It was a convention in Redux to use only pure functions inside the reducers and I think it a good convention to follow with React as well.

Copy link

@dianaatwizeline dianaatwizeline left a comment

Choose a reason for hiding this comment

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

Most of the code looks good except for the test cases which are missing and some of the ones you have are failing.

The deployed application on Netlify needs some love, as I'm able to do everything I expect except for watching the video while on Video Detail view and there is a bug with the favorites in that sometimes adding a new favorite removes the previous favorites.

At this point I think it is more a thing with bugfixing and implementing more tests than React proficiency.

function VideoCard({ videoDescription, videoTitle, videoThumbnail, videoId }) {
const { dispatch } = useVideoContext();

const handleVideoClick = () => {

Choose a reason for hiding this comment

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

would be better if these functions lived inside useVideoContext and took the payload as arguments so you don't need to worry about dispatching from here and you have the wrapper ready if you want to use these functions elsewhere

import { useVideoContext } from '../../store/VideoContext';

function VideoDetailPage() {
const { state } = useVideoContext();

Choose a reason for hiding this comment

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

Tip: You can get extra fancy with destructuring if you'd lke

const { state: {currentVideo}} = useVideoContext();

and then you can use currentVideo.videoThumbnail below

});

return (
<VideoContext.Provider value={{ state, dispatch }}>{children}</VideoContext.Provider>

Choose a reason for hiding this comment

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

it would be better to expose helper functions like setCurrentVideo and getFavoriteVideos instead of state and dispatch directly.

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.

3 participants