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

React1 week2/hossein#46

Open
hossein1065 wants to merge 4 commits into
HackYourFuture-CPH:mainfrom
hossein1065:react1-week2/hossein
Open

React1 week2/hossein#46
hossein1065 wants to merge 4 commits into
HackYourFuture-CPH:mainfrom
hossein1065:react1-week2/hossein

Conversation

@hossein1065
Copy link
Copy Markdown

I have completed all Week2 homework except the Navbar part

Comment thread app/destination/page.js
{numberOfPlanets === 0 ? (
<p>No planets in wishlist :</p>
) : (
<p>You have {numberOfPlanets} planet(s) in your wishlist</p>
Copy link
Copy Markdown

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 🙂

Comment thread app/destination/page.js
thumbnail="/destination/image-titan.png"
isSelected={selectedPlanets.includes("TITAN")}
onAddOrRemovePlanet={() => onAddOrRemovePlanet("TITAN")}
/>
Copy link
Copy Markdown

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!

Comment thread components/ui/Navbar.js

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

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
Copy Markdown

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