Пофиксил верстку сайдбара кандидатов
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import React, { useEffect } from 'react'
|
||||
import { useHistory, useParams, Link } from 'react-router-dom'
|
||||
import { useSelector, useDispatch } from 'react-redux'
|
||||
import React, {useEffect} from 'react'
|
||||
import {useHistory, useParams, Link} from 'react-router-dom'
|
||||
import {useSelector, useDispatch} from 'react-redux'
|
||||
import {
|
||||
currentCandidate,
|
||||
selectCurrentCandidate,
|
||||
@ -13,24 +13,23 @@ import SkillSection from '../SkillSection/SkillSection'
|
||||
import front from '../../images/front_end.png'
|
||||
import back from '../../images/back_end.png'
|
||||
import design from '../../images/design.png'
|
||||
import { fetchGet } from '../../server/server'
|
||||
import { Footer } from '../Footer/Footer'
|
||||
import {fetchGet} from '../../server/server'
|
||||
import {Footer} from '../Footer/Footer'
|
||||
|
||||
import './candidate.scss'
|
||||
import { getRole } from '../../redux/roleSlice'
|
||||
import { CodeSnippetlighter } from '../../pages/CodeSnippetPage'
|
||||
import { useState } from 'react'
|
||||
import {getRole} from '../../redux/roleSlice'
|
||||
import {useState} from 'react'
|
||||
|
||||
const Candidate = () => {
|
||||
const history = useHistory()
|
||||
const { id: candidateId } = useParams()
|
||||
const dispatch = useDispatch()
|
||||
const role = useSelector(getRole)
|
||||
const [activeSnippet, setActiveSnippet] = useState(true)
|
||||
const history = useHistory();
|
||||
const {id: candidateId} = useParams();
|
||||
const dispatch = useDispatch();
|
||||
const role = useSelector(getRole);
|
||||
const [activeSnippet, setActiveSnippet] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
window.scrollTo(0, 0)
|
||||
}, [])
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
fetchGet({
|
||||
@ -40,37 +39,37 @@ const Candidate = () => {
|
||||
role,
|
||||
logout: () => dispatch(auth(false))
|
||||
}).then((el) => dispatch(currentCandidate(el)))
|
||||
}, [dispatch, candidateId])
|
||||
}, [dispatch, candidateId]);
|
||||
|
||||
const currentCandidateObj = useSelector(selectCurrentCandidate)
|
||||
const currentCandidateObj = useSelector(selectCurrentCandidate);
|
||||
|
||||
const { position_id, skillValues, vc_text: text } = currentCandidateObj
|
||||
const {position_id, skillValues, vc_text: text} = currentCandidateObj;
|
||||
|
||||
const setStyles = () => {
|
||||
const styles = {
|
||||
classes: '',
|
||||
header: '',
|
||||
img: ''
|
||||
}
|
||||
};
|
||||
|
||||
switch (Number(position_id)) {
|
||||
case 1: {
|
||||
styles.classes = 'back'
|
||||
styles.header = 'Backend'
|
||||
styles.img = back
|
||||
styles.classes = 'back';
|
||||
styles.header = 'Backend';
|
||||
styles.img = back;
|
||||
|
||||
break
|
||||
}
|
||||
case 2: {
|
||||
styles.classes = 'des'
|
||||
styles.header = 'Frontend'
|
||||
styles.img = front
|
||||
styles.classes = 'des';
|
||||
styles.header = 'Frontend';
|
||||
styles.img = front;
|
||||
break
|
||||
}
|
||||
case 3: {
|
||||
styles.classes = 'front'
|
||||
styles.header = 'Design'
|
||||
styles.img = design
|
||||
styles.classes = 'front';
|
||||
styles.header = 'Design';
|
||||
styles.img = design;
|
||||
break
|
||||
}
|
||||
default:
|
||||
@ -78,32 +77,32 @@ const Candidate = () => {
|
||||
}
|
||||
|
||||
return styles
|
||||
}
|
||||
};
|
||||
|
||||
function createMarkup(text) {
|
||||
return { __html: text.split('</p>').join('</p>') }
|
||||
return {__html: text.split('</p>').join('</p>')}
|
||||
}
|
||||
|
||||
const { header, img, classes } = setStyles()
|
||||
|
||||
const {header, img, classes} = setStyles();
|
||||
|
||||
return (
|
||||
<div className='candidate'>
|
||||
<div className='row'>
|
||||
<div className='col-12'>
|
||||
<div className='candidate__title'>
|
||||
<h2>
|
||||
<span>Аутстаффинг</span> it-персонала
|
||||
</h2>
|
||||
<div className='candidate'>
|
||||
<div className='row'>
|
||||
<div className='col-12'>
|
||||
<div className='candidate__title'>
|
||||
<h2>
|
||||
<span>Аутстаффинг</span> it-персонала
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className='row'>
|
||||
<div className='col-12'>
|
||||
<div className='candidate__header'>
|
||||
<div className='row'>
|
||||
<div className='col-12 candidate__header'>
|
||||
|
||||
<div className='candidate__arrow' onClick={() => history.push('/')}>
|
||||
<div className='candidate__arrow-img'>
|
||||
<img src={arrow} alt='' />
|
||||
<img src={arrow} alt=''/>
|
||||
</div>
|
||||
<div className='candidate__arrow-sp'>
|
||||
<span>Вернуться к списку</span>
|
||||
@ -112,84 +111,91 @@ const Candidate = () => {
|
||||
|
||||
<div className='candidate__icon'>
|
||||
<h3>{header}</h3>
|
||||
<img className={classes} src={img} alt='' />
|
||||
<img className={classes} src={img} alt=''/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className='candidate__main'>
|
||||
<div className='row'>
|
||||
<div className='col-12 col-xl-4'>
|
||||
<Sidebar candidate={currentCandidateObj} position activeSnippet={activeSnippet} setActiveSnippet={setActiveSnippet}/>
|
||||
</div>
|
||||
{
|
||||
activeSnippet ?
|
||||
(
|
||||
<div className='col-12 col-xl-8'>
|
||||
<div className='candidate__main-description'>
|
||||
<img src={rectangle} alt='' />
|
||||
<p className='candidate__hashtag'># Описание опыта</p>
|
||||
{text ? (
|
||||
<div
|
||||
className='candidate__text'
|
||||
dangerouslySetInnerHTML={createMarkup(text)}
|
||||
></div>
|
||||
) : (
|
||||
<p className='candidate__text-secondary'>
|
||||
{currentCandidateObj.vc_text
|
||||
? currentCandidateObj.vc_text
|
||||
: 'Описание отсутствует...'}
|
||||
</p>
|
||||
)}
|
||||
{/* <Link to={`/candidate/${currentCandidateObj.id}/form`}>
|
||||
<div className='candidate__main'>
|
||||
<div className='row'>
|
||||
<div className='col-12 col-xl-4'>
|
||||
<Sidebar candidate={currentCandidateObj} position activeSnippet={activeSnippet}
|
||||
setActiveSnippet={setActiveSnippet}/>
|
||||
</div>
|
||||
{
|
||||
activeSnippet ?
|
||||
(
|
||||
<div className='col-12 col-xl-8'>
|
||||
<div className='candidate__main-description'>
|
||||
<img src={rectangle} alt=''/>
|
||||
<p className='candidate__hashtag'># Описание опыта</p>
|
||||
{text ? (
|
||||
<div
|
||||
className='candidate__text'
|
||||
dangerouslySetInnerHTML={createMarkup(text)}
|
||||
></div>
|
||||
) : (
|
||||
<p className='candidate__text-secondary'>
|
||||
{currentCandidateObj.vc_text
|
||||
? currentCandidateObj.vc_text
|
||||
: 'Описание отсутствует...'}
|
||||
</p>
|
||||
)}
|
||||
{/* <Link to={`/candidate/${currentCandidateObj.id}/form`}>
|
||||
<button type="submit" className='candidate__btn'>
|
||||
Выбрать к собеседованию
|
||||
</button>
|
||||
</Link> */}
|
||||
<SkillSection skillsArr={skillValues} />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
) :
|
||||
(
|
||||
// <div className="col-12 col-xl-8">
|
||||
// <CodeSnippetlighter />
|
||||
// </div>
|
||||
<div className="col-12 col-xl-8">
|
||||
<div className="candidate__works works">
|
||||
<div className="works__body">
|
||||
<div className="works__item item-works">
|
||||
<div className="item-works__body">
|
||||
<Link to="/" className="item-works__link">Vuetifyis.com</Link>
|
||||
<div className="item-works__text">Forked from peluprvi/vuetifyjs.com <br /> Vuetifyjs.com documentation</div>
|
||||
<div className="item-works__mark">Angular</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="works__item item-works">
|
||||
<div className="item-works__body">
|
||||
<Link to="/" className="item-works__link">Vuetifyis.com</Link>
|
||||
<div className="item-works__text">Forked from peluprvi/vuetifyjs.com <br /> Vuetifyjs.com documentation</div>
|
||||
<div className="item-works__mark">Angular</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="works__item item-works">
|
||||
<div className="item-works__body">
|
||||
<Link to="/" className="item-works__link">Vuetifyis.com</Link>
|
||||
<div className="item-works__text">Forked from peluprvi/vuetifyjs.com <br /> Vuetifyjs.com documentation</div>
|
||||
<div className="item-works__mark item-works__mark_yellow">Laravel</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<SkillSection skillsArr={skillValues}/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
) :
|
||||
(
|
||||
// <div className="col-12 col-xl-8">
|
||||
// <CodeSnippetlighter />
|
||||
// </div>
|
||||
<div className="col-12 col-xl-8">
|
||||
<div className="candidate__works works">
|
||||
<div className="works__body">
|
||||
<div className="works__item item-works">
|
||||
<div className="item-works__body">
|
||||
<Link to="/" className="item-works__link">Vuetifyis.com</Link>
|
||||
<div className="item-works__text">Forked from peluprvi/vuetifyjs.com <br/> Vuetifyjs.com
|
||||
documentation
|
||||
</div>
|
||||
<div className="item-works__mark">Angular</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="works__item item-works">
|
||||
<div className="item-works__body">
|
||||
<Link to="/" className="item-works__link">Vuetifyis.com</Link>
|
||||
<div className="item-works__text">Forked from peluprvi/vuetifyjs.com <br/> Vuetifyjs.com
|
||||
documentation
|
||||
</div>
|
||||
<div className="item-works__mark">Angular</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="works__item item-works">
|
||||
<div className="item-works__body">
|
||||
<Link to="/" className="item-works__link">Vuetifyis.com</Link>
|
||||
<div className="item-works__text">Forked from peluprvi/vuetifyjs.com <br/> Vuetifyjs.com
|
||||
documentation
|
||||
</div>
|
||||
<div className="item-works__mark item-works__mark_yellow">Laravel</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
</div>
|
||||
<Footer/>
|
||||
</div>
|
||||
<Footer />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
export default Candidate
|
||||
|
@ -6,7 +6,7 @@
|
||||
h2 {
|
||||
text-align: center;
|
||||
color: #52b709;
|
||||
font-family: 'GT Eesti Pro Display';
|
||||
font-family: 'GT Eesti Pro Display', sans-serif;
|
||||
font-size: 5em;
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
@ -25,8 +25,8 @@
|
||||
&__header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 120px;
|
||||
margin-left: 60px;
|
||||
}
|
||||
|
||||
&__main {
|
||||
@ -36,7 +36,7 @@
|
||||
padding-left: 16px;
|
||||
|
||||
h2 {
|
||||
font-family: 'GT Eesti Pro Display';
|
||||
font-family: 'GT Eesti Pro Display', sans-serif;
|
||||
font-size: 2.8em;
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
@ -46,21 +46,21 @@
|
||||
}
|
||||
|
||||
p {
|
||||
font-family: 'GT Eesti Pro Display';
|
||||
font-family: 'GT Eesti Pro Display', sans-serif;
|
||||
font-size: 1.2em;
|
||||
font-weight: 300;
|
||||
font-style: normal;
|
||||
letter-spacing: normal;
|
||||
line-height: 36px;
|
||||
text-align: left;
|
||||
margin: 20px 0px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__text {
|
||||
p {
|
||||
font-family: 'GT Eesti Pro Display';
|
||||
font-family: 'GT Eesti Pro Display', sans-serif;
|
||||
font-size: 1.6em;
|
||||
font-weight: 100;
|
||||
font-style: normal;
|
||||
@ -69,12 +69,11 @@
|
||||
}
|
||||
|
||||
&-secondary {
|
||||
font-family: 'GT Eesti Pro Display';
|
||||
font-family: 'GT Eesti Pro Display', sans-serif;
|
||||
font-size: 1.6em;
|
||||
font-weight: 100;
|
||||
font-style: normal;
|
||||
letter-spacing: normal;
|
||||
line-height: 24px;
|
||||
text-align: left;
|
||||
line-height: 28px;
|
||||
}
|
||||
@ -95,7 +94,7 @@
|
||||
position: absolute;
|
||||
right: 20%;
|
||||
top: 40%;
|
||||
font-family: 'GT Eesti Pro Display';
|
||||
font-family: 'GT Eesti Pro Display', sans-serif;
|
||||
font-size: 1.8em;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
@ -109,6 +108,13 @@
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
&-img {
|
||||
margin-right: 10px;
|
||||
}
|
||||
&-sp {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
footer {
|
||||
@ -138,7 +144,7 @@
|
||||
span {
|
||||
margin-left: 40px;
|
||||
margin-right: 120px;
|
||||
font-family: 'GT Eesti Pro Display';
|
||||
font-family: 'GT Eesti Pro Display', sans-serif;
|
||||
font-size: 1.8em;
|
||||
font-weight: 100;
|
||||
font-style: normal;
|
||||
@ -216,10 +222,9 @@
|
||||
rgba(255, 255, 255, 0) 100%
|
||||
);
|
||||
color: #ffffff;
|
||||
font-family: 'Muller';
|
||||
font-family: 'Muller', sans-serif;
|
||||
font-size: 1.3em;
|
||||
letter-spacing: normal;
|
||||
text-align: left;
|
||||
border: none;
|
||||
text-align: center;
|
||||
margin: 28px auto;
|
||||
@ -230,7 +235,7 @@
|
||||
|
||||
&-sp {
|
||||
span {
|
||||
margin-right: 0px;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -335,7 +340,7 @@
|
||||
|
||||
&__link{
|
||||
color: #0350dc;
|
||||
font-family: "GT Eesti Pro Display";
|
||||
font-family: "GT Eesti Pro Display", sans-serif;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
letter-spacing: normal;
|
||||
@ -347,7 +352,7 @@
|
||||
&__text{
|
||||
margin-bottom: 37px;
|
||||
color: #000000;
|
||||
font-family: "GT Eesti Pro Display - Thin";
|
||||
font-family: "GT Eesti Pro Display - Thin", sans-serif;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: math.div(18,12);
|
||||
|
Reference in New Issue
Block a user