Skip to content

Conversation

@tomergol15
Copy link

i added a commit about the modal, whaiting for pr :)

Copy link
Member

@Tamir198 Tamir198 left a 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;
Copy link
Member

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;
}
Copy link
Member

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}>
Copy link
Member

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>
Copy link
Member

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>
Copy link
Member

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;
Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

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");
}
Copy link
Member

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}
Copy link
Member

Choose a reason for hiding this comment

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

Remove this comment

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