Skip to content

Commit

Permalink
fix task solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Livan94 committed Nov 8, 2023
1 parent d1f47d3 commit 82291d3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/components/Person/Person.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ export const Person = ({ person }) => {
partnerName,
} = person;

const showAge = age
? <p className="Person__age">{`I am ${age}`}</p>
: null;

const partnerSex = sex === 'm'
? 'wife'
: 'husband';

return (
<section className="Person">
<h2 className="Person__name">{`My name is ${name}`}</h2>
{showAge}
{age && <p className="Person__age">{`I am ${age}`}</p>}
<p className="Person__partner">
{isMarried
? `${partnerName} is my ${partnerSex}`
Expand Down

0 comments on commit 82291d3

Please sign in to comment.