Skip to content

Commit

Permalink
Fixed 1
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslan-ihnatenko committed Aug 22, 2023
1 parent ca5124e commit f8e80b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export const alex = {

export const App = () => (
<div className="App">
<Person misha />
<Person olya />
<Person alex />
<Person person={misha} />
<Person person={olya} />
<Person person={alex} />
</div>
);
5 changes: 4 additions & 1 deletion src/components/Person/Person.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@

export function Person({ person }) {
const { name, age, sex, isMarried, partnerName } = person;
let partnerText;

const partnerText = `${partnerName} is my ${sex === 'f' ? 'husband' : 'wife'}`;
if (partnerName) {
partnerText = `${person.partnerName} is my ${sex === 'f' ? 'husband' : 'wife'}`;
}

return (
<section className="Person">
Expand Down

0 comments on commit f8e80b5

Please sign in to comment.