From e23545addc8eb3e33332ac885367581053b34a2a Mon Sep 17 00:00:00 2001 From: Konrad Date: Thu, 17 Aug 2023 20:13:25 +0200 Subject: [PATCH 1/3] init commit --- src/App.jsx | 7 ++----- src/components/Person/Person.jsx | 25 ++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index dcf8509c8..99736c708 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,11 +26,7 @@ export const alex = { export const App = () => (
-
-

My name is Misha

-

I am 37

-

Natasha is my wife

-
+

My name is Olya

diff --git a/src/components/Person/Person.jsx b/src/components/Person/Person.jsx index eccf156a3..7122a67a0 100644 --- a/src/components/Person/Person.jsx +++ b/src/components/Person/Person.jsx @@ -1 +1,24 @@ -// export const Person = ({ person }) => (); +export const Person = ({ person }) => { + const partner = person.sex === 'f' ? 'husband' : 'wife'; + const marriedStatus = person.isMarried + ? `${person.partnerName} is my ${partner}` + : 'I am not married'; + + return ( + <> +
+

{`My name is ${person.name}`}

+ + {person.age && ( +

+ {`I am ${person.age}`} +

+ )} + +

+ {marriedStatus} +

+
+ + ); +}; From 9f032ea720a71f40b540221733ec013f709a7ffc Mon Sep 17 00:00:00 2001 From: Konrad Date: Thu, 17 Aug 2023 20:13:56 +0200 Subject: [PATCH 2/3] addin github username --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3424ccb86..3f76f07fb 100644 --- a/README.md +++ b/README.md @@ -12,4 +12,4 @@ and use it 3 times inside the `App` instead of static markup. ## Instructions - Implement a solution following the [React task guideline](https://github.com/mate-academy/react_task-guideline#react-tasks-guideline). - Open one more terminal and run tests with `npm test` to ensure your solution is correct. -- Replace `` with your Github username in the [DEMO LINK](https://.github.io/react_person/) and add it to the PR description. +- Replace `` with your Github username in the [DEMO LINK](https://domalewski.github.io/react_person/) and add it to the PR description. From ccb24970d2e637519b6b7c45ff9d3f01af56ea61 Mon Sep 17 00:00:00 2001 From: Konrad Date: Fri, 18 Aug 2023 09:11:40 +0200 Subject: [PATCH 3/3] fixing Person component --- src/App.jsx | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 99736c708..c09fddf21 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -27,16 +27,7 @@ export const alex = { export const App = () => (
- -
-

My name is Olya

-

Maksym is my husband

-
- -
-

My name is Alex

-

I am 25

-

I am not married

-
+ +
);