From 011f9c7a00660a90832b5c9bf92868409492bc62 Mon Sep 17 00:00:00 2001 From: Maksym Huk Date: Wed, 20 May 2026 20:26:11 +0300 Subject: [PATCH 1/3] result --- src/App.jsx | 23 ++++------------------- src/components/Person/Person.jsx | 20 +++++++++++++++++++- src/components/Person/Person.spec.jsx | 1 + 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index dcf8509c84..69bf3e6ecc 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,4 +1,5 @@ import React from 'react'; +import Person from './components/Person/Person'; import './App.scss'; export const misha = { @@ -8,38 +9,22 @@ export const misha = { isMarried: true, partnerName: 'Natasha', }; - export const olya = { name: 'Olya', sex: 'f', isMarried: true, partnerName: 'Maksym', }; - export const alex = { name: 'Alex', age: 25, sex: 'm', isMarried: false, }; - export const App = () => (
-
-

My name is Misha

-

I am 37

-

Natasha is my wife

-
- -
-

My name is Olya

-

Maksym is my husband

-
- -
-

My name is Alex

-

I am 25

-

I am not married

-
+ + +
); diff --git a/src/components/Person/Person.jsx b/src/components/Person/Person.jsx index eccf156a37..78e4d9a258 100644 --- a/src/components/Person/Person.jsx +++ b/src/components/Person/Person.jsx @@ -1 +1,19 @@ -// export const Person = ({ person }) => (); +import React from 'react'; + +const Person = ({ person }) => { + return ( +
+

{person.name}

+ {person.age &&

Age: {person.age}

} + {person.isMarried ? ( +

+ {person.sex === 'm' ? 'Wife' : 'Husband'}: {person.partnerName} +

+ ) : ( +

I am not married

+ )} +
+ ); +}; + +export default Person; diff --git a/src/components/Person/Person.spec.jsx b/src/components/Person/Person.spec.jsx index e863082581..5db97e9ecb 100644 --- a/src/components/Person/Person.spec.jsx +++ b/src/components/Person/Person.spec.jsx @@ -1,3 +1,4 @@ +/* eslint-disable import/named */ import { mount } from '@cypress/react18'; import { Person } from './Person'; From 4386b3859a46930e38c483b00b60e7f6a5a23fb8 Mon Sep 17 00:00:00 2001 From: Maksym Huk Date: Thu, 21 May 2026 22:39:36 +0300 Subject: [PATCH 2/3] result3 --- src/components/Person/Person.jsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/Person/Person.jsx b/src/components/Person/Person.jsx index 78e4d9a258..775711c555 100644 --- a/src/components/Person/Person.jsx +++ b/src/components/Person/Person.jsx @@ -1,13 +1,17 @@ import React from 'react'; -const Person = ({ person }) => { +export const Person = ({ person }) => { + const partnerRole = person.sex === 'm' ? 'wife' : 'husband'; + return (
-

{person.name}

- {person.age &&

Age: {person.age}

} +

My name is {person.name}

+ + {person.age &&

I am {person.age}

} + {person.isMarried ? (

- {person.sex === 'm' ? 'Wife' : 'Husband'}: {person.partnerName} + {person.partnerName} is my {partnerRole}

) : (

I am not married

From a7832372eac5bcc9584826112dbbea7562616cb3 Mon Sep 17 00:00:00 2001 From: Maksym Huk Date: Thu, 21 May 2026 22:50:19 +0300 Subject: [PATCH 3/3] final --- src/App.jsx | 5 ++++- src/components/Person/Person.jsx | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 69bf3e6ecc..eb67351283 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import Person from './components/Person/Person'; +import { Person } from './components/Person/Person'; import './App.scss'; export const misha = { @@ -9,18 +9,21 @@ export const misha = { isMarried: true, partnerName: 'Natasha', }; + export const olya = { name: 'Olya', sex: 'f', isMarried: true, partnerName: 'Maksym', }; + export const alex = { name: 'Alex', age: 25, sex: 'm', isMarried: false, }; + export const App = () => (
diff --git a/src/components/Person/Person.jsx b/src/components/Person/Person.jsx index 775711c555..4bea15c109 100644 --- a/src/components/Person/Person.jsx +++ b/src/components/Person/Person.jsx @@ -19,5 +19,3 @@ export const Person = ({ person }) => {
); }; - -export default Person;