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

Mini challenge5 #99

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

Conversation

BigOsvaap
Copy link

No description provided.

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.

good PR. My biggest advice is to move the dispatch calls as I mention in the comment

};

return (
<>

Choose a reason for hiding this comment

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

I don't think this empty fragment <> is necessary here

`;

export function CardVideoBottom({ title, description }) {
function trucateText(text) {

Choose a reason for hiding this comment

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

this function can live outside CardVideoBottom so that it does not get redefined on every render

});
setButtonClicked(false);
} else {
dispatch({

Choose a reason for hiding this comment

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

As an optional challenge, try to move the dispatch calls to inside the FavoritesProvider so that way instead of exposing dispatch and need to remember the exact type of action, you expose more straightforward functions like addFavorite and deleteFavorite that take the payload as the only parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants