import React, { useEffect, useState } from "react"; import { useParams, Link, useNavigate, Navigate } from "react-router-dom"; import { useSelector, useDispatch } from "react-redux"; import SkillSection from "../SkillSection/SkillSection"; import Sidebar from "../CandidateSidebar/CandidateSidebar"; import { ProfileHeader } from "../ProfileHeader/ProfileHeader"; import { ProfileBreadcrumbs } from "../ProfileBreadcrumbs/ProfileBreadcrumbs"; import { Footer } from "../Footer/Footer"; import { currentCandidate, selectCurrentCandidate, } from "../../redux/outstaffingSlice"; import { apiRequest } from "../../api/request"; import { createMarkup } from "../../helper"; import gitImgItem from "../../images/gitItemImg.png"; import rectangle from "../../images/rectangle_secondPage.png"; import front from "../Outstaffing/images/front_end.png"; import back from "../Outstaffing/images/back_end.png"; import design from "../Outstaffing/images/design.png"; import rightArrow from "../../images/arrowRight.png"; import { LEVELS, SKILLS } from "../../constants/constants"; import "./candidate.scss"; import { Navigation } from "../Navigation/Navigation"; const Candidate = () => { if (localStorage.getItem("role_status") !== "18") { return ; } const { id: candidateId } = useParams(); const navigate = useNavigate(); const dispatch = useDispatch(); const currentCandidateObj = useSelector(selectCurrentCandidate); const [activeSnippet, setActiveSnippet] = useState(true); useEffect(() => { window.scrollTo(0, 0); }, []); useEffect(() => { apiRequest(`/profile/${candidateId}`, { params: Number(candidateId), }).then((el) => dispatch(currentCandidate(el))); }, [dispatch, candidateId]); 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; break; } case 2: { styles.classes = "des"; styles.header = "Frontend"; styles.img = front; break; } case 3: { styles.classes = "front"; styles.header = "Design"; styles.img = design; break; } default: break; } return styles; }; const { header, img, classes } = setStyles(); return (

{currentCandidateObj.specification}  {" "} {SKILLS[currentCandidateObj.position_id]}  {" "} {LEVELS[currentCandidateObj.level]}

navigate("/profile/catalog")} >
Вернуться к списку

{header}

{activeSnippet ? (

# Описание опыта

{text ? (
) : (

{currentCandidateObj.vc_text ? currentCandidateObj.vc_text : "Описание отсутствует..."}

)}
) : (

Страница портфолио кода разработчика

img
cybershop-api

Реактивная социальная сеть

arrow
JavaScript
img
cybershop-api

Реактивная социальная сеть

arrow
JavaScript
img
cybershop-api

Реактивная социальная сеть

arrow
JavaScript
)}
); }; export default Candidate;