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

react_person solution #1631

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

Conversation

Vitalii-Petruk
Copy link

Copy link

@Moroz-Dmytro Moroz-Dmytro left a comment

Choose a reason for hiding this comment

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

Small comments

src/App.jsx Outdated
<p className="Person__age">I am 37</p>
<p className="Person__partner">Natasha is my wife</p>
</section>
<Person person={misha} />

Choose a reason for hiding this comment

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

Delete blank lines between components

return (
<section className="Person">
<h2 className="Person__name">
{`My name is ${person.name}`}

Choose a reason for hiding this comment

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

Use destructuring for all values

{`My name is ${person.name}`}
</h2>

{Boolean(person.age) > 0 && (

Choose a reason for hiding this comment

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

Suggested change
{Boolean(person.age) > 0 && (
{Boolean(person.age) && (

</p>
)}

<p className="Person__partner">{marriageInformation}</p>

Choose a reason for hiding this comment

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

Suggested change
<p className="Person__partner">{marriageInformation}</p>
<p className="Person__partner">
{marriageInformation}
</p>

Copy link

@Yevheniia-Sid Yevheniia-Sid left a comment

Choose a reason for hiding this comment

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

Good job!👍

Copy link

@roman-mirzoian roman-mirzoian 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, but pay attention to the comment.

Comment on lines 6 to 8
const spouseGender = sex === 'm'
? 'wife'
: 'husband';

Choose a reason for hiding this comment

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

It would be cool to keep such data in separate constants:

const MALE = 'm';
const WIFE = 'wife';
const HUSBAND = 'husband';
...
const spouseGender = sex === MALE
  ? WIFE
  : HUSABAND;

Copy link
Author

Choose a reason for hiding this comment

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

oh, I really didn't see it, sorry, I'll redo it now, thanks

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