From f42f7a9f71f1f2137de78df02ffc8f0ff31659e4 Mon Sep 17 00:00:00 2001 From: Hope87 Date: Wed, 21 Jul 2021 14:40:06 +0300 Subject: [PATCH] fixed description css --- src/components/Candidate/Candidate.module.css | 10 ++++- src/components/Candidate/SectionSkills.js | 2 +- src/components/Description/Description.js | 30 +++++++------ .../Description/Description.module.css | 14 +++---- src/components/Form/Form.js | 3 -- src/components/Form/Form.module.css | 1 - src/components/Home/Home.js | 6 +-- src/server/server.js | 42 +++++++++++-------- 8 files changed, 60 insertions(+), 48 deletions(-) diff --git a/src/components/Candidate/Candidate.module.css b/src/components/Candidate/Candidate.module.css index e0758cd9..bbb577d9 100644 --- a/src/components/Candidate/Candidate.module.css +++ b/src/components/Candidate/Candidate.module.css @@ -222,7 +222,6 @@ margin-top: 60px; border-radius: 10px; margin-bottom: 60px; - flex-wrap: wrap; } @media (max-width: 575.98px) { @@ -241,7 +240,14 @@ text-align: left; } -.SectionSkills > p { +.SectionSkills > ul { + list-style: none; + display: flex; + padding-left: 0; + flex-wrap: wrap; +} + +.SectionSkills > ul > li { font-family: 'GT Eesti Pro Display'; font-size: 1.8em; font-weight: 100; diff --git a/src/components/Candidate/SectionSkills.js b/src/components/Candidate/SectionSkills.js index c1ba8b9c..0e05d935 100644 --- a/src/components/Candidate/SectionSkills.js +++ b/src/components/Candidate/SectionSkills.js @@ -5,7 +5,7 @@ const SectionSkills = ({ skillsArr }) => { return (

Навыки:

- {skillsArr && skillsArr.map((skills) =>

{skills.skill.name}

)} +
); }; diff --git a/src/components/Description/Description.js b/src/components/Description/Description.js index f486c9c3..c956db78 100644 --- a/src/components/Description/Description.js +++ b/src/components/Description/Description.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useEffect, useState } from 'react'; import style from './Description.module.css'; import male from '../../images/medium_male.png'; import rectangle from '../../images/rectangle_secondPage.png'; @@ -6,14 +6,16 @@ import { Link } from 'react-router-dom'; import { LEVELS, SKILLS } from '../constants/constants'; import { selectProfiles, selectFilteredCandidates } from '../../redux/outstaffingSlice'; import { useSelector } from 'react-redux'; +import { fetchProfile } from '../../server/server'; const Description = ({ onLoadMore }) => { const candidatesListArr = useSelector(selectProfiles); const filteredListArr = useSelector(selectFilteredCandidates); + const [allCandidates, getAllCandidates] = useState([]); - // function createMarkup(text) { - // return { __html: text.split('

').slice(0, 3).join('') }; - // } + useEffect(() => { + fetchProfile('https://guild.craft-group.xyz/api/profile?limit=', 1000).then((p) => getAllCandidates(p)); + }, []); return (
@@ -43,13 +45,13 @@ const Description = ({ onLoadMore }) => {
-
+
    {el.skillValues.map((e) => ( - +
  • {e.skill.name} - +
  • ))} -
+
@@ -78,13 +80,13 @@ const Description = ({ onLoadMore }) => {
-
+
    {el.skillValues.map((e) => ( - +
  • {e.skill.name} - +
  • ))} -
+
@@ -96,7 +98,9 @@ const Description = ({ onLoadMore }) => {
- + {candidatesListArr.length !== allCandidates.length && filteredListArr.length === 0 ? ( + + ) : null}
diff --git a/src/components/Description/Description.module.css b/src/components/Description/Description.module.css index ac5e0f52..90cd2921 100644 --- a/src/components/Description/Description.module.css +++ b/src/components/Description/Description.module.css @@ -85,10 +85,6 @@ word-wrap: break-word; } -/* .description__text > p:first-child { - font-size: 1.8em; -} */ - .description__textSecondary { font-family: 'GT Eesti Pro Display'; font-size: 1.7em; @@ -152,11 +148,14 @@ } } -.description__spBox { +.description__list { padding: 5px; + list-style: none; + display: flex; + flex-wrap: wrap; } -.description__sp { +.description__list__item { font-family: 'GT Eesti Pro Display'; font-size: 1.7em; font-weight: 400; @@ -164,13 +163,12 @@ letter-spacing: normal; text-align: left; line-height: 36px; - margin-top: 20px; margin-left: 10px; word-wrap: break-word; } @media (max-width: 575.98px) { - .description__sp { + .description__list__item { font-size: 1.5em; text-align: center; margin-bottom: 120px; diff --git a/src/components/Form/Form.js b/src/components/Form/Form.js index ee3f7b01..e3cd7787 100644 --- a/src/components/Form/Form.js +++ b/src/components/Form/Form.js @@ -24,7 +24,6 @@ const Form = () => { const handleSubmit = (e) => { e.preventDefault(); - console.log('submitData', data); const formData = new FormData(); formData.append('email', data.email); @@ -38,8 +37,6 @@ const Form = () => { history.goBack(); }; - console.log('data', data); - return (
diff --git a/src/components/Form/Form.module.css b/src/components/Form/Form.module.css index 8c625c7d..03e6f17a 100644 --- a/src/components/Form/Form.module.css +++ b/src/components/Form/Form.module.css @@ -15,7 +15,6 @@ line-height: 16.81px; text-align: left; margin-bottom: 20px; - margin-left: 45px; } .form > input { diff --git a/src/components/Home/Home.js b/src/components/Home/Home.js index 46895912..52d1f491 100644 --- a/src/components/Home/Home.js +++ b/src/components/Home/Home.js @@ -11,9 +11,9 @@ const Home = () => { const dispatch = useDispatch(); useEffect(() => { - fetchProfile('https://guild.craft-group.xyz/api/profile?limit=', index) - .then((profileArr) => dispatch(profiles(profileArr))) - .catch((e) => console.log(e)); + fetchProfile('https://guild.craft-group.xyz/api/profile?limit=', index).then((profileArr) => + dispatch(profiles(profileArr)) + ); fetchSkills('https://guild.craft-group.xyz/api/skills/skills-on-main-page').then((skills) => { const keys = Object.keys(skills); diff --git a/src/server/server.js b/src/server/server.js index d9ee160e..18fc8516 100644 --- a/src/server/server.js +++ b/src/server/server.js @@ -1,32 +1,40 @@ export const fetchProfile = async (link, index) => { - const response = await fetch(`${link}${index}`); - let data = await response.json(); + try { + const response = await fetch(`${link}${index}`); + let data = await response.json(); - return data; + return data; + } catch (error) {} }; export const fetchSkills = async (link) => { - const response = await fetch(link); - let data = await response.json(); + try { + const response = await fetch(link); + let data = await response.json(); - return data; + return data; + } catch (error) {} }; export const fetchItemsForId = async (link, id) => { - const response = await fetch(`${link}${id}`); - let data = await response.json(); + try { + const response = await fetch(`${link}${id}`); + let data = await response.json(); - return data; + return data; + } catch (error) {} }; export const fetchForm = async (link, info) => { - const response = await fetch(link, { - method: 'POST', - headers: { - 'Content-Type': 'multipart/form-data', - }, - body: info, - }); + try { + const response = await fetch(link, { + method: 'POST', + headers: { + 'Content-Type': 'multipart/form-data', + }, + body: info, + }); - return response; + return response; + } catch (error) {} };