From 35fa372bdd40ed60bb8b7da765a06de767703a89 Mon Sep 17 00:00:00 2001 From: kurpfish Date: Wed, 15 Sep 2021 17:07:28 +0300 Subject: [PATCH] profile achievements added --- src/components/Achievement/Achievement.js | 19 ++++++ src/components/Achievement/achievement.scss | 35 ++++++++++ src/components/Sidebar/Sidebar.js | 64 ++++++++++++------- .../{Sidebar.module.css => sidebar.scss} | 23 +++++-- 4 files changed, 110 insertions(+), 31 deletions(-) create mode 100644 src/components/Achievement/Achievement.js create mode 100644 src/components/Achievement/achievement.scss rename src/components/Sidebar/{Sidebar.module.css => sidebar.scss} (86%) diff --git a/src/components/Achievement/Achievement.js b/src/components/Achievement/Achievement.js new file mode 100644 index 00000000..fbcfc336 --- /dev/null +++ b/src/components/Achievement/Achievement.js @@ -0,0 +1,19 @@ +import React from 'react' + +import './achievement.scss' + +export const Achievement = ({ achievement }) => { + return ( +
+
+ +
+
+
{achievement.title}
+
+ {achievement.description} +
+
+
+ ) +} diff --git a/src/components/Achievement/achievement.scss b/src/components/Achievement/achievement.scss new file mode 100644 index 00000000..cdfc99b4 --- /dev/null +++ b/src/components/Achievement/achievement.scss @@ -0,0 +1,35 @@ +.achievement { + position: relative; + width: 50px; + height: 50px; + margin: 0 1rem; + + &__popup { + position: absolute; + top: 50px; + left: 0; + width: 140px; + height: 60px; + padding: 1rem; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + display: none; + text-align: left; + } + + &__icon { + width: 50px; + height: 50px; + } + + img { + width: 100%; + height: 100%; + } + + &:hover .achievement__popup { + display: block; + } +} diff --git a/src/components/Sidebar/Sidebar.js b/src/components/Sidebar/Sidebar.js index 7fa5e4bf..0c8cf3e8 100644 --- a/src/components/Sidebar/Sidebar.js +++ b/src/components/Sidebar/Sidebar.js @@ -1,37 +1,53 @@ -import React from 'react'; -import { Link } from 'react-router-dom'; -import maleBig from '../../images/medium_male_big.png'; -import style from './Sidebar.module.css'; +import React from 'react' +import { Link } from 'react-router-dom' +import { Achievement } from '../Achievement/Achievement' + +import maleBig from '../../images/medium_male_big.png' +import './sidebar.scss' const getYearsString = (years) => { - let yearsString; - if (years%10 === 1) { - yearsString = 'год'; + let yearsString + if (years % 10 === 1) { + yearsString = 'год' } else if (years === 11 || years === 12 || years === 13 || years === 14) { - yearsString = 'лет'; - } else if (years%10 === 2 || years%10 === 3 || years%10 === 4) { - yearsString = 'года'; + yearsString = 'лет' + } else if (years % 10 === 2 || years % 10 === 3 || years % 10 === 4) { + yearsString = 'года' } else { - yearsString = 'лет'; + yearsString = 'лет' } - return `${years} ${yearsString}`; + return `${years} ${yearsString}` } const Sidebar = ({ candidate }) => { + console.log('c', candidate) return ( -
-
- - { candidate && candidate.years_of_exp && <> -

Опыт работы

-

{getYearsString(candidate.years_of_exp)}

- } - - +
+
+ + {candidate && candidate.years_of_exp && ( + <> +

Опыт работы

+

+ {getYearsString(candidate.years_of_exp)} +

+ + )} + + +
+ {candidate && + candidate.achievements && + candidate.achievements.map((item) => { + return + })} +
- ); -}; + ) +} -export default Sidebar; +export default Sidebar diff --git a/src/components/Sidebar/Sidebar.module.css b/src/components/Sidebar/sidebar.scss similarity index 86% rename from src/components/Sidebar/Sidebar.module.css rename to src/components/Sidebar/sidebar.scss index 04efe60f..d1d991cc 100644 --- a/src/components/Sidebar/Sidebar.module.css +++ b/src/components/Sidebar/sidebar.scss @@ -6,6 +6,14 @@ border-bottom: none !important; position: sticky; top: 80px; + + &__achievements { + display: flex; + flex-wrap: wrap; + justify-content: flex-start; + padding: 0 1rem; + margin-bottom: 80px; + } } .candidateSidebar__info { @@ -25,7 +33,7 @@ border-radius: 100px; } -.candidateSidebar__info__e { +.candidateSidebar__experience-title { font-family: 'GT Eesti Pro Display'; font-size: 1.8em; font-weight: normal; @@ -35,7 +43,7 @@ margin-top: 20px; } -.candidateSidebar__info__y { +.candidateSidebar__experience { font-family: 'GT Eesti Pro Display'; font-size: 3em; font-weight: 700; @@ -44,7 +52,7 @@ line-height: normal; } -.candidateSidebar__info__btn { +.candidateSidebar__select { width: 280px; height: 60px; border-radius: 100px; @@ -58,10 +66,10 @@ line-height: normal; text-align: center; margin-top: 20px; - margin-bottom: 120px; + margin-bottom: 40px; } -.candidateSidebar__info__btn:hover { +.candidateSidebar__select:hover { background: rgba(0, 0, 0, 0); color: #73c141; box-shadow: inset 0 0 0 3px #73c141; @@ -142,7 +150,8 @@ flex-direction: column; } - .candidateSidebar__info__e, .candidateSidebar__info__y { + .candidateSidebar__info__e, + .candidateSidebar__info__y { width: 180px; } -} \ No newline at end of file +}