diff --git a/README.md b/README.md index 009a2977c..d5e19df37 100644 --- a/README.md +++ b/README.md @@ -13,4 +13,4 @@ and use it 3 times inside the `App` instead of static markup. - Install Prettier Extention and use this [VSCode settings](https://mate-academy.github.io/fe-program/tools/vscode/settings.json) to enable format on save. - 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://Nazarin565.github.io/react_person/) and add it to the PR description. diff --git a/src/App.jsx b/src/App.jsx index dcf8509c8..741099881 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 = { @@ -24,22 +25,9 @@ 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/App.scss b/src/App.scss index 223ec3872..21274fdb6 100644 --- a/src/App.scss +++ b/src/App.scss @@ -16,5 +16,9 @@ iframe { &__age { color: #00f; font-weight: bold; + + &--hidden { + display: none; + } } } diff --git a/src/components/Person/Person.jsx b/src/components/Person/Person.jsx index eccf156a3..d5d3cbf44 100644 --- a/src/components/Person/Person.jsx +++ b/src/components/Person/Person.jsx @@ -1 +1,17 @@ -// export const Person = ({ person }) => (); +export const Person = ({ person }) => { + const partner = person.sex === 'm' ? 'wife' : 'husband'; + + return ( +
+
+

My name is {person.name}

+ {person.age &&

I am {person.age}

} +

+ {person.isMarried + ? `${person.partnerName} is my ${partner}` + : 'I am not married'} +

+
+
+ ); +};