-
-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Added files #309
Added files #309
Conversation
Hey! Congratulations on your PR! 😎😎😎 Let's do some self-checks to fix most common issues and to make some improvements to the code before reviewers put their hands on the code. Go through the requirements/most common mistakes listed/linked below and fix the code as appropriate. If you have any questions to requirements/common mistakes feel free asking them here or in Students' chat. When you genuinely believe you are done put a comment stating that you have completed self-checks and fixed code accordingly. Also, be aware, that if you would silently ignore this recommendation, a mentor can think that you are still working on fixes. And your PR will not be reviewed. 😒 Please, make sure you haven't made common mistakes Universal recommendations:
Also take a note of the requirements above and follow them in all your future projects. By the way, you may proceed to the next task before this one is reviewed and merged. Sincerely yours, |
Had checked my code for common mistakes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work. See some comments below.
const renderContent = (pasta) => {
const {name, image, .....} = pasta;
const template = `${name} .....`;
//insert to mainContentWrap
}
const getContent = ({ target }) => {
if( .... ) {
const selectedPasta = contentData.find(pasta => pasta.name === target.innerText);
renderContent(selectedPasta);
}
}
menu.addEventListener('click', getContent)
1582ede
to
a8d899a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do a little change in the code.
Separate event listener and function.
Create separate functions:
- renderData()
- getSelectData()
- cleanContent()
- toglgleActiveMenuItem()
…iveMenuItem, renderData, cleanContent, getSelectData
Thanks for the comment. I was trying to figure out how to implement this functionality and got this, I'm not quite sure if it's right, but I couldn't think of any other way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, I approve of your work. Good luck with future tasks!
DOM
Demo |
Code base
The code is submitted in a dedicated feature branch.
Only code files are submitted.
Please, review.