profilePage

This commit is contained in:
2022-12-28 09:45:26 +03:00
parent d81110d7d5
commit cabd01ca43
10 changed files with 531 additions and 138 deletions

View File

@ -1,70 +1,142 @@
import React, {useEffect, useState} from 'react';
import React, {useState} from 'react';
import { ProfileHeader } from "../components/Profile/ProfileHeader";
import { setProfileInfo, getProfileInfo } from "../redux/outstaffingSlice";
import {useDispatch, useSelector} from "react-redux";
import { fetchGet } from '../../src/server/server'
import {Link} from "react-router-dom";
import { getProfileInfo } from "../redux/outstaffingSlice";
import { useSelector } from "react-redux";
import {transformHtml} from "../helper";
import { Footer } from '../components/Footer/Footer'
import arrow from "../images/right-arrow.png";
import rightArrow from "../images/arrowRight.png"
import gitImgItem from "../images/gitItemImg.png"
import './../components/Profile/profile.scss'
export const Profile = () => {
const dispatch = useDispatch();
const profileInfo = useSelector(getProfileInfo)
useEffect(() => {
fetchGet({
link: `${process.env.REACT_APP_API_URL}/api/profile/get-main-data?user_id=${localStorage.getItem('id')}`,
}).then((profileInfo) => {
dispatch(setProfileInfo(profileInfo))
})
}, [dispatch, localStorage.getItem('id')])
const [openGit, setOpenGit] = useState(false);
return(
<div className='profile'>
<ProfileHeader/>
<div className='profile__container'>
<ProfileHeader/>
<div className='profile__content'>
<div className='profile__sideBar'>
<h2 className='profile__sideBar__position'>{profileInfo.position_name} {profileInfo.specification}</h2>
<img className='profile__avatar' src={profileInfo.photo} />
<span className='profile__sideBar-name'>{profileInfo.fio}</span>
<p className='profile__sideBar__experience'>Опыт работы: <span>{profileInfo.years_of_exp}года</span></p>
</div>
<div className='profile__content__info'>
<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>
<h2 className='profile__title'>Ваше резюме {openGit && <span>- Git</span>}</h2>
{openGit && <div className='profile__back' onClick={() => setOpenGit(false)}>
<img src={arrow} alt='arrow'/>
<p>Вернуться</p>
</div>}
<div className='profile__info'>
<div className='profile__person'>
<img src={profileInfo.photo} className='profile__avatar' />
<p className='profile__name'>{profileInfo.fio} {profileInfo.specification}</p>
</div>
<Link to={`/ProfileCalendar`}>
<button className='candidate-sidebar__select'>
Отчёты
</button>
</Link>
{!openGit &&
<button className='profile__git' onClick={()=> setOpenGit(true)}>Git</button>
}
</div>
</div>
{!openGit &&
<div className='profile__skills skills__section'>
<div className='profile__sections__head'>
<h3>Основной стек</h3>
<button>Редактировать раздел</button>
</div>
<div className='skills__section__items'>
<div className='skills__section__items__wrapper'>
{profileInfo.skillValues && profileInfo.skillValues.map((skill) => {
return <span key={skill.id} className='skill_item'>{skill.skill.name}</span>
})}
</div>
</div>
</div>
}
{profileInfo.vc_text && !openGit &&
<div className='profile__experience' dangerouslySetInnerHTML={transformHtml(profileInfo.vc_text)}>
</div>
}
{openGit &&
<div className='profile__sectionGit'>
<div className='profile__sections__head'>
<h3>Страница портфолио кода разработчика</h3>
<button>Редактировать раздел</button>
</div>
<div className='profile__sectionGitItems'>
<div className='profile__sectionGitItem gitItem'>
<div className='gitItem__info'>
<div className='gitItem__info__about'>
<img src={gitImgItem} alt='gitImg' />
<div className='gitItem__info__name'>
<h4>cybershop-api</h4>
<p>Реактивная социальная сеть</p>
</div>
</div>
<div className='gitItem__info__specification'>
<span></span>
<p>JavaScript</p>
</div>
</div>
<a className='gitItem__link'>
<img src={rightArrow} alt='arrowRight' />
</a>
</div>
<div className='profile__sectionGitItem gitItem'>
<div className='gitItem__info'>
<div className='gitItem__info__about'>
<img src={gitImgItem} alt='gitImg' />
<div className='gitItem__info__name'>
<h4>cybershop-api</h4>
<p>Реактивная социальная сеть</p>
</div>
</div>
<div className='gitItem__info__specification'>
<span></span>
<p>JavaScript</p>
</div>
</div>
<a className='gitItem__link'>
<img src={rightArrow} alt='arrowRight' />
</a>
</div>
<div className='profile__sectionGitItem gitItem'>
<div className='gitItem__info'>
<div className='gitItem__info__about'>
<img src={gitImgItem} alt='gitImg' />
<div className='gitItem__info__name'>
<h4>cybershop-api</h4>
<p>Реактивная социальная сеть</p>
</div>
</div>
<div className='gitItem__info__specification'>
<span></span>
<p>JavaScript</p>
</div>
</div>
<a className='gitItem__link'>
<img src={rightArrow} alt='arrowRight' />
</a>
</div>
<div className='profile__sectionGitItem gitItem'>
<div className='gitItem__info'>
<div className='gitItem__info__about'>
<img src={gitImgItem} alt='gitImg' />
<div className='gitItem__info__name'>
<h4>cybershop-api</h4>
<p>Реактивная социальная сеть</p>
</div>
</div>
<div className='gitItem__info__specification'>
<span></span>
<p>JavaScript</p>
</div>
</div>
<a className='gitItem__link'>
<img src={rightArrow} alt='arrowRight' />
</a>
</div>
</div>
</div>
}
</div>
<Footer/>
</div>
)
}