fixed description css

This commit is contained in:
Hope87 2021-07-21 14:40:06 +03:00
parent bccc5f98dc
commit f42f7a9f71
8 changed files with 60 additions and 48 deletions

View File

@ -222,7 +222,6 @@
margin-top: 60px; margin-top: 60px;
border-radius: 10px; border-radius: 10px;
margin-bottom: 60px; margin-bottom: 60px;
flex-wrap: wrap;
} }
@media (max-width: 575.98px) { @media (max-width: 575.98px) {
@ -241,7 +240,14 @@
text-align: left; 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-family: 'GT Eesti Pro Display';
font-size: 1.8em; font-size: 1.8em;
font-weight: 100; font-weight: 100;

View File

@ -5,7 +5,7 @@ const SectionSkills = ({ skillsArr }) => {
return ( return (
<div className={style.SectionSkills}> <div className={style.SectionSkills}>
<h3>Навыки:</h3> <h3>Навыки:</h3>
{skillsArr && skillsArr.map((skills) => <p key={skills.id}>{skills.skill.name}</p>)} <ul>{skillsArr && skillsArr.map((skills) => <li key={skills.id}>{skills.skill.name}</li>)}</ul>
</div> </div>
); );
}; };

View File

@ -1,4 +1,4 @@
import React from 'react'; import React, { useEffect, useState } from 'react';
import style from './Description.module.css'; import style from './Description.module.css';
import male from '../../images/medium_male.png'; import male from '../../images/medium_male.png';
import rectangle from '../../images/rectangle_secondPage.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 { LEVELS, SKILLS } from '../constants/constants';
import { selectProfiles, selectFilteredCandidates } from '../../redux/outstaffingSlice'; import { selectProfiles, selectFilteredCandidates } from '../../redux/outstaffingSlice';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import { fetchProfile } from '../../server/server';
const Description = ({ onLoadMore }) => { const Description = ({ onLoadMore }) => {
const candidatesListArr = useSelector(selectProfiles); const candidatesListArr = useSelector(selectProfiles);
const filteredListArr = useSelector(selectFilteredCandidates); const filteredListArr = useSelector(selectFilteredCandidates);
const [allCandidates, getAllCandidates] = useState([]);
// function createMarkup(text) { useEffect(() => {
// return { __html: text.split('</p>').slice(0, 3).join('') }; fetchProfile('https://guild.craft-group.xyz/api/profile?limit=', 1000).then((p) => getAllCandidates(p));
// } }, []);
return ( return (
<section className={style.description}> <section className={style.description}>
@ -43,13 +45,13 @@ const Description = ({ onLoadMore }) => {
</div> </div>
<div className="col-xl-2"></div> <div className="col-xl-2"></div>
<div className="col-12 col-xl-6"> <div className="col-12 col-xl-6">
<div className={style.description__spBox}> <ul className={style.description__list}>
{el.skillValues.map((e) => ( {el.skillValues.map((e) => (
<span key={e.id} className={style.description__sp}> <li key={e.id} className={style.description__list__item}>
{e.skill.name} {e.skill.name}
</span> </li>
))} ))}
</div> </ul>
<img className={style.description__rectangle} src={rectangle} alt="" /> <img className={style.description__rectangle} src={rectangle} alt="" />
</div> </div>
<div className="col-xl-4"></div> <div className="col-xl-4"></div>
@ -78,13 +80,13 @@ const Description = ({ onLoadMore }) => {
</div> </div>
<div className="col-xl-2"></div> <div className="col-xl-2"></div>
<div className="col-12 col-xl-6"> <div className="col-12 col-xl-6">
<div className={style.description__spBox}> <ul className={style.description__list}>
{el.skillValues.map((e) => ( {el.skillValues.map((e) => (
<span key={e.id} className={style.description__sp}> <li key={e.id} className={style.description__list__item}>
{e.skill.name} {e.skill.name}
</span> </li>
))} ))}
</div> </ul>
<img className={style.description__rectangle} src={rectangle} alt="" /> <img className={style.description__rectangle} src={rectangle} alt="" />
</div> </div>
<div className="col-xl-4"></div> <div className="col-xl-4"></div>
@ -96,7 +98,9 @@ const Description = ({ onLoadMore }) => {
<div className="col-12"> <div className="col-12">
<div className={style.description__footer}> <div className={style.description__footer}>
<div className={style.description__footer__btn}> <div className={style.description__footer__btn}>
{candidatesListArr.length !== allCandidates.length && filteredListArr.length === 0 ? (
<button onClick={() => onLoadMore(2)}>Загрузить еще</button> <button onClick={() => onLoadMore(2)}>Загрузить еще</button>
) : null}
</div> </div>
</div> </div>
</div> </div>

View File

@ -85,10 +85,6 @@
word-wrap: break-word; word-wrap: break-word;
} }
/* .description__text > p:first-child {
font-size: 1.8em;
} */
.description__textSecondary { .description__textSecondary {
font-family: 'GT Eesti Pro Display'; font-family: 'GT Eesti Pro Display';
font-size: 1.7em; font-size: 1.7em;
@ -152,11 +148,14 @@
} }
} }
.description__spBox { .description__list {
padding: 5px; padding: 5px;
list-style: none;
display: flex;
flex-wrap: wrap;
} }
.description__sp { .description__list__item {
font-family: 'GT Eesti Pro Display'; font-family: 'GT Eesti Pro Display';
font-size: 1.7em; font-size: 1.7em;
font-weight: 400; font-weight: 400;
@ -164,13 +163,12 @@
letter-spacing: normal; letter-spacing: normal;
text-align: left; text-align: left;
line-height: 36px; line-height: 36px;
margin-top: 20px;
margin-left: 10px; margin-left: 10px;
word-wrap: break-word; word-wrap: break-word;
} }
@media (max-width: 575.98px) { @media (max-width: 575.98px) {
.description__sp { .description__list__item {
font-size: 1.5em; font-size: 1.5em;
text-align: center; text-align: center;
margin-bottom: 120px; margin-bottom: 120px;

View File

@ -24,7 +24,6 @@ const Form = () => {
const handleSubmit = (e) => { const handleSubmit = (e) => {
e.preventDefault(); e.preventDefault();
console.log('submitData', data);
const formData = new FormData(); const formData = new FormData();
formData.append('email', data.email); formData.append('email', data.email);
@ -38,8 +37,6 @@ const Form = () => {
history.goBack(); history.goBack();
}; };
console.log('data', data);
return ( return (
<div className="container"> <div className="container">
<div className="row"> <div className="row">

View File

@ -15,7 +15,6 @@
line-height: 16.81px; line-height: 16.81px;
text-align: left; text-align: left;
margin-bottom: 20px; margin-bottom: 20px;
margin-left: 45px;
} }
.form > input { .form > input {

View File

@ -11,9 +11,9 @@ const Home = () => {
const dispatch = useDispatch(); const dispatch = useDispatch();
useEffect(() => { useEffect(() => {
fetchProfile('https://guild.craft-group.xyz/api/profile?limit=', index) fetchProfile('https://guild.craft-group.xyz/api/profile?limit=', index).then((profileArr) =>
.then((profileArr) => dispatch(profiles(profileArr))) dispatch(profiles(profileArr))
.catch((e) => console.log(e)); );
fetchSkills('https://guild.craft-group.xyz/api/skills/skills-on-main-page').then((skills) => { fetchSkills('https://guild.craft-group.xyz/api/skills/skills-on-main-page').then((skills) => {
const keys = Object.keys(skills); const keys = Object.keys(skills);

View File

@ -1,25 +1,32 @@
export const fetchProfile = async (link, index) => { export const fetchProfile = async (link, index) => {
try {
const response = await fetch(`${link}${index}`); const response = await fetch(`${link}${index}`);
let data = await response.json(); let data = await response.json();
return data; return data;
} catch (error) {}
}; };
export const fetchSkills = async (link) => { export const fetchSkills = async (link) => {
try {
const response = await fetch(link); const response = await fetch(link);
let data = await response.json(); let data = await response.json();
return data; return data;
} catch (error) {}
}; };
export const fetchItemsForId = async (link, id) => { export const fetchItemsForId = async (link, id) => {
try {
const response = await fetch(`${link}${id}`); const response = await fetch(`${link}${id}`);
let data = await response.json(); let data = await response.json();
return data; return data;
} catch (error) {}
}; };
export const fetchForm = async (link, info) => { export const fetchForm = async (link, info) => {
try {
const response = await fetch(link, { const response = await fetch(link, {
method: 'POST', method: 'POST',
headers: { headers: {
@ -29,4 +36,5 @@ export const fetchForm = async (link, info) => {
}); });
return response; return response;
} catch (error) {}
}; };