From 596c54b0027ac6570f71036993e480c3e8040e18 Mon Sep 17 00:00:00 2001 From: kurpfish Date: Mon, 9 Aug 2021 18:40:06 +0300 Subject: [PATCH 1/3] sort fixes --- src/components/Description/Description.js | 103 ++++++++++++---------- src/redux/outstaffingSlice.js | 2 +- 2 files changed, 58 insertions(+), 47 deletions(-) diff --git a/src/components/Description/Description.js b/src/components/Description/Description.js index 17e298b7..313fa3b6 100644 --- a/src/components/Description/Description.js +++ b/src/components/Description/Description.js @@ -4,12 +4,13 @@ import male from '../../images/medium_male.png'; import rectangle from '../../images/rectangle_secondPage.png'; import { Link } from 'react-router-dom'; import { LEVELS, SKILLS } from '../constants/constants'; -import { selectProfiles, selectFilteredCandidates } from '../../redux/outstaffingSlice'; +import { selectProfiles, selectFilteredCandidates, selectItems } from '../../redux/outstaffingSlice'; import { useSelector } from 'react-redux'; import { fetchProfile } from '../../server/server'; const Description = ({ onLoadMore }) => { const candidatesListArr = useSelector(selectProfiles); + const itemsArr = useSelector(selectItems); const filteredListArr = useSelector(selectFilteredCandidates); const [allCandidates, getAllCandidates] = useState([]); @@ -17,60 +18,69 @@ const Description = ({ onLoadMore }) => { fetchProfile(`${process.env.REACT_APP_API_URL}/api/profile?limit=`, 1000).then((p) => getAllCandidates(p)); }, []); + console.log('render',filteredListArr, itemsArr) + + if(!filteredListArr) { + return ( +
+
+
+ { + candidatesListArr.map((el) => ( +
+
+ +
+
+

+ {SKILLS[el.position_id]}, {LEVELS[el.level]} +

+ + {el.vc_text_short ? ( +
{el.vc_text_short}
+ ) : ( +

Описание отсутствует...

+ )} +
+
+ + + +
+
+
+
    + {el.skillValues.map((e) => ( +
  • + {e.skill.name} +
  • + ))} +
+ +
+
+
+ ))} +
+ +
+
+ ); + } + return (
{filteredListArr - ? (filteredListArr.length > 0 - ? <> - : filteredListArr.map((el) => ( -
-
- -
-
-

- - {SKILLS[el.position_id]}, {LEVELS[el.level]} - -

- - {el.vc_text_short ? ( -
{el.vc_text_short}
- ) : ( -

Описание отсутствует...

- )} -
-
- - - -
-
-
-
    - {el.skillValues.map((e) => ( -
  • - {e.skill.name} -
  • - ))} -
- -
-
-
- ))) - : candidatesListArr.map((el) => ( + ? filteredListArr.map((el) => (

- - {SKILLS[el.position_id]}, {LEVELS[el.level]} - + {SKILLS[el.position_id]}, {LEVELS[el.level]}

{el.vc_text_short ? ( @@ -97,14 +107,15 @@ const Description = ({ onLoadMore }) => {
- ))} + )) + : filteredListArr.length && filteredListArr.length === 0 && <> }
- {candidatesListArr.length !== allCandidates.length && filteredListArr.length === 0 ? ( + {(candidatesListArr.length !== allCandidates.length && filteredListArr.length > 0) || filteredListArr===null ? ( ) : null}
diff --git a/src/redux/outstaffingSlice.js b/src/redux/outstaffingSlice.js index a2e893f9..44f9fdaf 100644 --- a/src/redux/outstaffingSlice.js +++ b/src/redux/outstaffingSlice.js @@ -3,7 +3,7 @@ import { createSlice } from '@reduxjs/toolkit'; const initialState = { tags: [], profiles: [], - filteredCandidates: [], + filteredCandidates:null, selectedItems: [], currentCandidate: {}, auth: false, From 6e2952c4359a8dfe108f035cf8e077275274ce3e Mon Sep 17 00:00:00 2001 From: kurpfish Date: Wed, 11 Aug 2021 14:37:20 +0300 Subject: [PATCH 2/3] buttons styling --- src/components/Auth/AuthForDevelopers.js | 43 ++++++++++--------- .../Auth/AuthForDevelopers.module.css | 12 ++++-- src/components/Auth/AuthForPartners.js | 2 + .../Auth/AuthForPartners.module.css | 12 ++++-- src/components/LogoutButton/logoutButton.css | 18 ++++---- 5 files changed, 53 insertions(+), 34 deletions(-) diff --git a/src/components/Auth/AuthForDevelopers.js b/src/components/Auth/AuthForDevelopers.js index 2acf1375..65be31e8 100644 --- a/src/components/Auth/AuthForDevelopers.js +++ b/src/components/Auth/AuthForDevelopers.js @@ -67,27 +67,30 @@ const AuthForDevelopers = () => { onChange={(e) => setPassword(e.target.value)} /> - +
+ + + +
-
diff --git a/src/components/Auth/AuthForDevelopers.module.css b/src/components/Auth/AuthForDevelopers.module.css index 8c1b888c..2433e9da 100644 --- a/src/components/Auth/AuthForDevelopers.module.css +++ b/src/components/Auth/AuthForDevelopers.module.css @@ -132,8 +132,14 @@ outline: none; } +.form__buttons { + display: flex; + justify-content: start; + align-items: center; +} + .form__btn { - width: 288px; + width: 268px; height: 75px; box-shadow: 6px 5px 20px rgba(82, 151, 34, 0.21); border-radius: 38px; @@ -154,6 +160,7 @@ line-height: 71.88px; text-align: center; border: 2px solid #6aaf5c; + margin-right: 1.5rem; } .form__btn:hover .loader * { @@ -169,7 +176,7 @@ } .form__btn__partners { - width: 288px; + width: 268px; height: 75px; border-radius: 38px; background-color: #ffffff; @@ -432,7 +439,6 @@ .auth__link { display: block; - margin-top: 1.3rem; } diff --git a/src/components/Auth/AuthForPartners.js b/src/components/Auth/AuthForPartners.js index 265e3887..e174e9ab 100644 --- a/src/components/Auth/AuthForPartners.js +++ b/src/components/Auth/AuthForPartners.js @@ -62,6 +62,7 @@ const AuthForPartners = () => { onChange={(e) => setPassword(e.target.value)} /> +
+
diff --git a/src/components/Auth/AuthForPartners.module.css b/src/components/Auth/AuthForPartners.module.css index 0df03c43..9465fc8d 100644 --- a/src/components/Auth/AuthForPartners.module.css +++ b/src/components/Auth/AuthForPartners.module.css @@ -132,8 +132,14 @@ outline: none; } +.form__buttons { + display: flex; + justify-content: start; + align-items: center; +} + .form__btn { - width: 288px; + width: 268px; height: 75px; box-shadow: 6px 5px 20px rgba(82, 151, 34, 0.21); border-radius: 38px; @@ -154,6 +160,7 @@ line-height: 71.88px; text-align: center; border: 2px solid #6aaf5c; + margin-right: 1.5rem; } .form__btn:hover { @@ -166,7 +173,7 @@ .form__btn__dev { - width: 288px; + width: 268px; height: 75px; border-radius: 38px; background-color: #ffffff; @@ -430,7 +437,6 @@ .auth__link { display: block; - margin-top: 1.3rem; } .auth__link a { diff --git a/src/components/LogoutButton/logoutButton.css b/src/components/LogoutButton/logoutButton.css index 61213fb9..ccb1c11c 100644 --- a/src/components/LogoutButton/logoutButton.css +++ b/src/components/LogoutButton/logoutButton.css @@ -1,7 +1,7 @@ .logout-button { position: fixed; - top: 2rem; - right: 3.5rem; + top: 70px; + right: 2.5rem; z-index: 100; } @@ -10,21 +10,23 @@ justify-content: center; align-items: center; margin: 0; - padding: 1rem 2rem; - border-radius: 20px; + width: 131px; + height: 40px; + border-radius: 10px; + font-family: 'Muller'; + font-size: 1.6em; + letter-spacing: 0.8px; background-color: #6aaf5c; color: #ffffff; - border: 2px solid #6aaf5c; + border: 3px solid #6aaf5c; font-family: 'Muller'; - font-size: 2em; - letter-spacing: normal; text-align: center; } .logout-button:hover button { background-color: #ffffff; color: #6aaf5c; - border: 2px solid #6aaf5c; + border: 3px solid #6aaf5c; box-shadow: 3px 2px 5px rgba(82, 151, 34, 0.21); transition: .3s; } \ No newline at end of file From 78ca0497941bbfaec61759247fe45c3ff8bf4165 Mon Sep 17 00:00:00 2001 From: kurpfish Date: Wed, 11 Aug 2021 15:19:59 +0300 Subject: [PATCH 3/3] mobile styling fixes --- src/components/Auth/AuthForDevelopers.module.css | 11 +++++++++++ src/components/Auth/AuthForPartners.module.css | 11 +++++++++++ src/components/LogoutButton/logoutButton.css | 9 ++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/components/Auth/AuthForDevelopers.module.css b/src/components/Auth/AuthForDevelopers.module.css index 2433e9da..9642ce39 100644 --- a/src/components/Auth/AuthForDevelopers.module.css +++ b/src/components/Auth/AuthForDevelopers.module.css @@ -447,4 +447,15 @@ width: 100%; height: 100%; color: #fff; +} + +@media (max-width: 766px) { + .form__buttons { + flex-direction: column; + } + + .form__btn { + margin: 0; + margin-bottom: 1.5rem; + } } \ No newline at end of file diff --git a/src/components/Auth/AuthForPartners.module.css b/src/components/Auth/AuthForPartners.module.css index 9465fc8d..7728cbc6 100644 --- a/src/components/Auth/AuthForPartners.module.css +++ b/src/components/Auth/AuthForPartners.module.css @@ -444,4 +444,15 @@ width: 100%; height: 100%; color: #fff; +} + +@media (max-width: 766px) { + .form__buttons { + flex-direction: column; + } + + .form__btn { + margin: 0; + margin-bottom: 1.5rem; + } } \ No newline at end of file diff --git a/src/components/LogoutButton/logoutButton.css b/src/components/LogoutButton/logoutButton.css index ccb1c11c..4f872af4 100644 --- a/src/components/LogoutButton/logoutButton.css +++ b/src/components/LogoutButton/logoutButton.css @@ -29,4 +29,11 @@ border: 3px solid #6aaf5c; box-shadow: 3px 2px 5px rgba(82, 151, 34, 0.21); transition: .3s; -} \ No newline at end of file +} + +@media (max-width: 1198px) { + .logout-button { + top: 16px; + } + } + \ No newline at end of file