-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
practical task 3 #1521
base: master
Are you sure you want to change the base?
practical task 3 #1521
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provide demo_link to description for review
src/components/Person/Person.jsx
Outdated
@@ -1 +1,35 @@ | |||
// export const Person = ({ person }) => (); | |||
|
|||
export const Person = ({ person }) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Destructure person
src/components/Person/Person.jsx
Outdated
{person.hasOwnProperty('age') | ||
? ( | ||
<p className="Person__age"> | ||
{`I am ${person.age}`} | ||
</p> | ||
) : null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{person.hasOwnProperty('age') | |
? ( | |
<p className="Person__age"> | |
{`I am ${person.age}`} | |
</p> | |
) : null} | |
{person.age && ( | |
<p className="Person__age"> | |
{`I am ${person.age}`} | |
</p> | |
)} |
src/components/Person/Person.jsx
Outdated
{person.isMarried === false | ||
? ( | ||
<p className="Person__partner"> | ||
I am not married | ||
</p> | ||
) : null} | ||
|
||
{ person.hasOwnProperty('partnerName') && person.sex === 'f' && ( | ||
<p className="Person__partner"> | ||
{`${person.partnerName} is my husband`} | ||
</p> | ||
)} | ||
|
||
{ person.hasOwnProperty('partnerName') && person.sex === 'm' && ( | ||
<p className="Person__partner"> | ||
{`${person.partnerName} is my wife`} | ||
</p> | ||
)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marriage text move to variable and combine tags into 1. It should be looks like this
{person.isMarried === false | |
? ( | |
<p className="Person__partner"> | |
I am not married | |
</p> | |
) : null} | |
{ person.hasOwnProperty('partnerName') && person.sex === 'f' && ( | |
<p className="Person__partner"> | |
{`${person.partnerName} is my husband`} | |
</p> | |
)} | |
{ person.hasOwnProperty('partnerName') && person.sex === 'm' && ( | |
<p className="Person__partner"> | |
{`${person.partnerName} is my wife`} | |
</p> | |
)} | |
<p className="Person__partner"> | |
{person.isMarried | |
? `${person.partnerName} is my ${yourAwesomeVariableName}` | |
: 'I am not married'} | |
</p> | |
)} |
@@ -1 +1,24 @@ | |||
// export const Person = ({ person }) => (); | |||
|
|||
export const Person = ({ person }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.