change profile

This commit is contained in:
2022-12-26 15:12:01 +03:00
parent f452e8b4b5
commit d81110d7d5
15 changed files with 478 additions and 23 deletions

71
src/pages/Profile.js Normal file
View File

@ -0,0 +1,71 @@
import React, {useEffect, 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 './../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')])
return(
<div className='profile'>
<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>
</div>
<Link to={`/ProfileCalendar`}>
<button className='candidate-sidebar__select'>
Отчёты
</button>
</Link>
</div>
</div>
</div>
</div>
)
}

View File

@ -0,0 +1,9 @@
import React from 'react';
import { WithLogout } from '../hoc/withLogout';
import { ProfileCalendar } from '../../src/components/ProfileCalendar/ProfileCalendar';
const ProfileCalendarPage = () => {
return <WithLogout><ProfileCalendar/></WithLogout>;
};
export default ProfileCalendarPage;