From ac25634e49e86c45e31894758bbfd1ec3b153ede Mon Sep 17 00:00:00 2001 From: Olexander Date: Sat, 2 Nov 2024 16:19:19 +0200 Subject: [PATCH] Solution --- src/App.jsx | 20 ++++---------------- src/components/Person/Person.jsx | 13 ++++++++++++- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index dcf8509c8..c09fddf21 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,5 +1,6 @@ import React from 'react'; import './App.scss'; +import { Person } from './components/Person/Person'; export const misha = { name: 'Misha', @@ -25,21 +26,8 @@ export const alex = { 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 eccf156a3..090718ef4 100644 --- a/src/components/Person/Person.jsx +++ b/src/components/Person/Person.jsx @@ -1 +1,12 @@ -// export const Person = ({ person }) => (); +export const Person = ({ person }) => ( +
+

My name is {person.name}

+ {/*

{person.age > 0 ? `I am ${person.age}` : ''}

*/} + {person.age > 0 ?

I am {person.age}

: ''} +

+ {person.isMarried === true + ? `${person.partnerName} is my ${person.sex === 'm' ? 'wife' : 'husband'}` + : 'I am not married'} +

+
+);