Skip to content

Conversation

@A-Bahadory
Copy link

@A-Bahadory A-Bahadory commented Jan 31, 2024

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@netlify
Copy link

netlify bot commented Jan 31, 2024

Deploy Preview for cyf-marcuszagorski-tv ready!

Name Link
🔨 Latest commit 57f8a65
🔍 Latest deploy log https://app.netlify.com/sites/cyf-marcuszagorski-tv/deploys/65bac8233d4b1a000848f73f
😎 Deploy Preview https://deploy-preview-2--cyf-marcuszagorski-tv.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@A-Bahadory A-Bahadory changed the title completed level 200 , added search input and dropdown menu with functionality WM5| AHMADZAY BAHADORY| TV-SHOW| completed level 200| Added search input and dropdown menu with functionality. Jan 31, 2024
@A-Bahadory
Copy link
Author

@MarcusZagorski
@kaliali436
Hi guys , I have completed level 200 for TV-show project, please if you could review my code,I will be happy for your constructive feedback to level up my coding skills .
thumbs up if you understand 😁

@MarcusZagorski MarcusZagorski self-requested a review February 5, 2024 22:26
Copy link
Owner

@MarcusZagorski MarcusZagorski left a comment

Choose a reason for hiding this comment

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

Overall some very good code Bahadory. Keep up the good work! I've noted a few points that can help you

let getEpi = getAllEpisodes();

function getEpiName(getEpi) {
for (let i = 0; i < getEpi.length; i++) {
Copy link
Owner

@MarcusZagorski MarcusZagorski Feb 5, 2024

Choose a reason for hiding this comment

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

Very nice for loop. Do you think a for each loop would be more beneficial in this scenario?

episode.name.toLowerCase().includes(searchTerm)
);

layoutSelector.innerHTML = "";
Copy link
Owner

Choose a reason for hiding this comment

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

Could you use a function that you've already created to handle this?

defaultOption.textContent = "Please select...";
episodeSelect.appendChild(defaultOption);

episodes.forEach((episode) => {
Copy link
Owner

Choose a reason for hiding this comment

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

forEach is an excellent choice! Well done!

});

episodeSelect.addEventListener("change", (event) => {
const selectedEpisodeName = event.target.value;
Copy link
Owner

Choose a reason for hiding this comment

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

Well done! I like that you've used a variable here to specify what the event.target.value is


if (selectedEpisodeName === "Please select...") {
clearRender();
const allEpisodes = getAllEpisodes();
Copy link
Owner

Choose a reason for hiding this comment

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

Do you think getAllEpisodes() needs to be declared again? If so why?

});
}

episodeSelector.addEventListener("input", function () {
Copy link
Owner

Choose a reason for hiding this comment

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

Do you think we should use "input" or "change" as the event listener? Look up what the difference is between them

<body>
<div id="root"></div>
<div class="input-wrapper">
<input type="search" id="episodeSearch" placeholder="Search Episodes" />
Copy link
Owner

Choose a reason for hiding this comment

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

What other tag do we need for this input type to help with accessibility?

@MarcusZagorski MarcusZagorski self-requested a review February 5, 2024 22:53
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