Skip to content
This repository was archived by the owner on Oct 14, 2025. It is now read-only.

Conversation

@hossein1065
Copy link

I have completed all Week2 homework except the Navbar part

{numberOfPlanets === 0 ? (
<p>No planets in wishlist :</p>
) : (
<p>You have {numberOfPlanets} planet(s) in your wishlist</p>

Choose a reason for hiding this comment

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

Here you could use a template string to add plural to planet only when the numberOfPlanets is bigger then 1 🙂

thumbnail="/destination/image-titan.png"
isSelected={selectedPlanets.includes("TITAN")}
onAddOrRemovePlanet={() => onAddOrRemovePlanet("TITAN")}
/>

Choose a reason for hiding this comment

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

Good job using the component here! You could save the information in an array and then map through it to make it more modular!


{navbarItems.map((item , index)=>(
<NavItem key={index} title={`${index+1} ${item.title}`} link={item.link} isActive={item.link===currentPath}
/>

Choose a reason for hiding this comment

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

Good job using map here!

@desafree
Copy link

Good job! Keep it up 🫡

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants