Skip to content

Commit

Permalink
fix person
Browse files Browse the repository at this point in the history
  • Loading branch information
dubyuliia committed Jul 27, 2023
1 parent 9032e2c commit 367c0e1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/Person/Person.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import './Person.scss';

function getPartnerRelationship(person) {
return person.sex === 'm' ? 'wife' : 'husband';
}

export const Person = ({ person }) => (
<section className="Person">
<h2 className="Person__name">
Expand All @@ -15,10 +19,7 @@ export const Person = ({ person }) => (
<p>I am not married</p>
) : (
<p>
{`${person.partnerName} is my ${person.sex === 'm'
? 'wife'
: 'husband'
}`}
{`${person.partnerName} is my ${getPartnerRelationship(person)}`}
</p>
)}
</p>
Expand Down

0 comments on commit 367c0e1

Please sign in to comment.