From 772e3b278df7eafc476150692813ae2f5ea3afef Mon Sep 17 00:00:00 2001
From: lanalightmj
Date: Mon, 16 Dec 2024 20:38:55 +0200
Subject: [PATCH] task sollution
---
src/App.jsx | 36 ++++++++++++++++++--------------
src/components/Person/Person.jsx | 20 +++++++++++++++++-
2 files changed, 39 insertions(+), 17 deletions(-)
diff --git a/src/App.jsx b/src/App.jsx
index dcf8509c8..e61f13802 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -1,6 +1,8 @@
import React from 'react';
import './App.scss';
+import { Person } from './components/Person/Person';
+
export const misha = {
name: 'Misha',
age: 37,
@@ -25,21 +27,23 @@ 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..1d69a8408 100644
--- a/src/components/Person/Person.jsx
+++ b/src/components/Person/Person.jsx
@@ -1 +1,19 @@
-// export const Person = ({ person }) => ();
+export const Person = ({ person }) => (
+
+ {`My name is ${person.name}`}
+
+ {person.age ?
I am ${person.age}
: null}
+
+ {person.isMarried === true ? (
+
+ {person.sex === 'm' ? (
+
${person.partnerName} is my wife
+ ) : (
+ ${person.partnerName} is my husband
+ )}
+
+ ) : (
+ I am not married
+ )}
+
+);