-
Notifications
You must be signed in to change notification settings - Fork 22
Countries api #22
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?
Countries api #22
Conversation
… and by search, and add func of change to dark mode - react actions
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.
Please remove all of the logs that you have
Other than that I left you come comments
| right: 0.4rem; | ||
| background: none; | ||
| /* border: none; */ | ||
| border-color:white; |
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.
Remove this comment
| justify-content: center; | ||
| align-items: center; | ||
| z-index: 1000; | ||
| } |
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.
Can you use lower z-index number?
| <div>Country</div> | ||
| ) | ||
| } | ||
| <div className="country scale-effect" onClick={onClick}> |
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 job here on destruct the props
| <ul className="country-brief"> | ||
| <li><strong>Population: </strong>{population}</li> | ||
| <li><strong>Region: </strong>{region}</li> | ||
| <li><strong>Capital: </strong>{capital}</li> |
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 the strong tag, add style via css
| <div className="search-wrapper"> | ||
| <i className="fa-regular fa-magnifying-glass search-icon"></i> | ||
| <input type="text" class="search-input" placeholder="Search for a country..." onInput={()=>props.filterBySearchFunc(event)}/> | ||
| </div> |
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.
If you destruct your props you would not need to do this via props.
|
|
||
| const Modal = ({ selectedCountry, isOpen, onClose }) => { | ||
| if (!isOpen) return null; | ||
| const { name, flags, population, region, capital } = selectedCountry; |
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.
This is a component, explain why do you return null and not jsx
| .then((data)=>{ | ||
| console.log(data); | ||
| setfilteredArray(data); | ||
| setOriginalArray(data); |
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.
Remove console logs from here
| console.log(region); | ||
|
|
||
| if(region==="All"){ | ||
| setfilteredArray(originalArray); |
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.
Save this into constant file
| document.body.classList.toggle("dark-theme", !isDarkMode); | ||
| } else { | ||
| document.body.classList.remove("dark-theme"); | ||
| } |
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.
Why do you need the else in here? toggle will take care of the class name wont it ?
| </main> | ||
| <Modal | ||
| selectedCountry={selectedCountry} //props | ||
| isOpen={isModalOpen} |
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.
Remove this comment
i added a commit about the modal, whaiting for pr :)