Skip to content

Commit

Permalink
add changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nazarin565 committed May 20, 2024
1 parent 0b72ed7 commit ec1e765
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/components/Person/Person.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
export const Person = ({ person }) => (
<div className="App">
<section className="Person">
<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">
{person.isMarried &&
person.sex === 'm' &&
`${person.partnerName} is my wife`}
{person.isMarried &&
person.sex === 'f' &&
`${person.partnerName} is my husband`}
{!person.isMarried && `I am not married`}
</p>
</section>
</div>
);
export const Person = ({ person }) => {
const partner = person.sex === 'm' ? 'wife' : 'husband';

return (
<div className="App">
<section className="Person">
<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">
{person.isMarried
? `${person.partnerName} is my ${partner}`
: 'I am not married'}
</p>
</section>
</div>
);
};

0 comments on commit ec1e765

Please sign in to comment.