Skip to content
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

Solution #2694

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Solution #2694

wants to merge 2 commits into from

Conversation

LiliiaVol
Copy link

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Great job! 🎉 Your implementation meets all the task requirements and constraints perfectly. The components are well-structured, and you've handled props and conditional rendering effectively. Keep up the excellent work! 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

Copy link

@BudnikOleksii BudnikOleksii left a comment

Choose a reason for hiding this comment

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

Good work 👍
Let's try to simplify a bit

src/App.jsx Outdated

<section className="Person">
{/* <section className="Person">

Choose a reason for hiding this comment

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

Remove all comments

@@ -1 +1,24 @@
// export const Person = ({ person }) => ();
export const Person = ({ person }) => {
let marriedLabel = <p className="Person__partner">I am not married</p>;

Choose a reason for hiding this comment

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

You have <p className="Person__partner"> in all cases

Comment on lines 5 to 13
if (person.sex === 'm' && person.isMarried) {
marriedLabel = (
<p className="Person__partner">{person.partnerName} is my wife</p>
);
}

if (person.sex === 'f' && person.isMarried) {
marriedLabel = (
<p className="Person__partner">{person.partnerName} is my husband</p>

Choose a reason for hiding this comment

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

Try to simplify to avoid repeating

Copy link

@VolodymyrKirichenko VolodymyrKirichenko left a comment

Choose a reason for hiding this comment

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

Well done 🔥

Comment on lines +10 to +12
<h2 className="Person__name">My name is {person.name}</h2>
{person.age && <p className="Person__age">I am {person.age}</p>}
<p className="Person__partner">{marriedLabel}</p>

Choose a reason for hiding this comment

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

Don't forget about indents(more readable)

Suggested change
<h2 className="Person__name">My name is {person.name}</h2>
{person.age && <p className="Person__age">I am {person.age}</p>}
<p className="Person__partner">{marriedLabel}</p>
<h2 className="Person__name">My name is {person.name}</h2>
{person.age && (
<p className="Person__age">I am {person.age}</p>
)}
<p className="Person__partner">{marriedLabel}</p>

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.

4 participants