Skip to content

Commit

Permalink
add task solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavlo-lab-max-Kopalko committed Dec 5, 2024
1 parent e32bc0f commit 836d550
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/Person/Person.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ export const Person = ({ person }) => {
if (person.sex === 'm') {
partner = 'wife';
} else {
partner = 'husbant';
partner = 'husband';
}

return (
<section className="Person">
<h2 className="Person__name">My name is {person.name}</h2>
{person.age && <p className="Person__age">I am {person.age}</p>}
{person.isMarried === true && (
{person.isMarried === true ? (
<p className="Person__partner">
{person.partnerName} is my {partner}
</p>
) : (
<p className="Person__partner">I am not married</p>
)}
</section>
);
Expand Down

0 comments on commit 836d550

Please sign in to comment.