Skip to content

Commit

Permalink
fixed task
Browse files Browse the repository at this point in the history
  • Loading branch information
lanalightmj committed Dec 17, 2024
1 parent 772e3b2 commit b9fd79d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
17 changes: 3 additions & 14 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,11 @@ export const alex = {
export const App = () => (
<div className="App">
<Person
person={{
name: 'Misha',
age: 37,
sex: 'm',
isMarried: true,
partnerName: 'Natasha',
}}
person={misha}
/>
<Person
person={{
name: 'Olya',
sex: 'f',
isMarried: true,
partnerName: 'Maksym',
}}
person={olya}
/>
<Person person={{ name: 'Alex', age: 25, sex: 'm', isMarried: false }} />
<Person person={alex} />
</div>
);
6 changes: 3 additions & 3 deletions src/components/Person/Person.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ export const Person = ({ person }) => (
<section className="Person">
<h2 className="Person__name">{`My name is ${person.name}`}</h2>
<p className="Person__age">
{person.age ? <p>I am ${person.age}</p> : null}
{person.age ? <span>I am ${person.age}</span> : null}
</p>
{person.isMarried === true ? (
<p className="Person__partner">
{person.sex === 'm' ? (
<p>${person.partnerName} is my wife</p>
<span>${person.partnerName} is my wife</span>
) : (
<p>${person.partnerName} is my husband</p>
<span>${person.partnerName} is my husband</span>
)}
</p>
) : (
Expand Down

0 comments on commit b9fd79d

Please sign in to comment.