-
Notifications
You must be signed in to change notification settings - Fork 28
Noa countries #12
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
base: main
Are you sure you want to change the base?
Noa countries #12
Conversation
Tamir198
left a comment
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.
Generally don`t use console log
Remove your event listeners after done using them
Hardcoded strings should be inside constants files
| countryElement.setAttribute('data-country-name', country.name); | ||
|
|
||
| countryElement.innerHTML = ` | ||
| <div class="country-flag"> |
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 not use innerHTML because it is a dangerous method
| dropdownHeader.addEventListener('click', toggleDropdown); | ||
| document.addEventListener('click', closeDropdownOnClickOutside); | ||
| dropdownBody.addEventListener('click', handleRegionSelect); | ||
|
|
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.
You can wrap this inside a function and call this function
| async function displayCountryDetails() { | ||
| try { | ||
| const urlParams = new URLSearchParams(window.location.search); | ||
| const countryName = urlParams.get('country'); |
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.
You should extract this into a service exposing the relevant logic as methods
| const loader = document.querySelector('.loader'); | ||
| if (loader) { | ||
| loader.style.display = 'none'; | ||
| } |
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 not style via js, do it with css classes
No description provided.