Переписываю спорные решения
Фикс отправки отчета, проверка на массив в map в Description.js
This commit is contained in:
13
src/HOOks/useRequest.js
Normal file
13
src/HOOks/useRequest.js
Normal file
@ -0,0 +1,13 @@
|
||||
import axios from 'axios';
|
||||
import {getToken, urlHasParams} from "../helper";
|
||||
import {useLogout} from "./useLogout";
|
||||
|
||||
|
||||
|
||||
export const useRequest = () => {
|
||||
|
||||
|
||||
|
||||
|
||||
return {apiRequest}
|
||||
};
|
@ -1,48 +1,54 @@
|
||||
// import axios from 'axios';
|
||||
// import {getToken, urlHasParams} from "../helper";
|
||||
//
|
||||
//
|
||||
//
|
||||
// const instance = axios.create({
|
||||
// baseURL: process.env.REACT_APP_API_URL,
|
||||
// validateStatus(status) {
|
||||
// return status;
|
||||
// },
|
||||
// });
|
||||
//
|
||||
// export default function request(url, {method = 'get', params, data, headers} = {}) {
|
||||
// const fullHeaders = {...headers, ...getToken()};
|
||||
// let urWithParams = urlHasParams(url);
|
||||
//
|
||||
//
|
||||
// return instance
|
||||
// .request({
|
||||
// url: urWithParams,
|
||||
// method,
|
||||
// params,
|
||||
// data,
|
||||
// headers: {...fullHeaders},
|
||||
// })
|
||||
// .then(response => new Promise(resolve => {
|
||||
// console.log(response, 1)
|
||||
// if(response.data.redirect || response.status === 401) {
|
||||
//
|
||||
// // window.location.href = "/auth"
|
||||
// }
|
||||
// return resolve(response)
|
||||
// }))
|
||||
// .then(response => new Promise(resolve => resolve(response.data)))
|
||||
// }
|
||||
//
|
||||
// function RequestError(code, msg, data) {
|
||||
// const description = msg ? `- ${msg}` : '';
|
||||
//
|
||||
// this.name = 'RequestError';
|
||||
// this.message = `API returned: ${code}${description}.`;
|
||||
// this.code = code;
|
||||
// this.description = msg;
|
||||
// this.data = data;
|
||||
// }
|
||||
//
|
||||
// RequestError.prototype = Object.create(Error.prototype);
|
||||
// RequestError.prototype.constructor = RequestError;
|
||||
import axios from 'axios';
|
||||
import {getToken, urlHasParams} from "../helper";
|
||||
|
||||
|
||||
|
||||
const instance = axios.create({
|
||||
baseURL: process.env.REACT_APP_API_URL,
|
||||
validateStatus(status) {
|
||||
return status;
|
||||
},
|
||||
});
|
||||
|
||||
export const apiRequest = (url, {
|
||||
method = 'get', params, data,
|
||||
headers = {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
} = {}) => {
|
||||
const fullHeaders = {...headers, ...getToken()};
|
||||
let urWithParams = urlHasParams(url);
|
||||
|
||||
|
||||
return instance
|
||||
.request({
|
||||
url: urWithParams,
|
||||
method,
|
||||
params,
|
||||
data,
|
||||
headers: {...fullHeaders},
|
||||
})
|
||||
.then(response => new Promise(resolve => {
|
||||
if (response.data.redirect || response.status === 401) {
|
||||
window.location.reduce('/');
|
||||
localStorage.clear();
|
||||
// dispatch(auth(false));
|
||||
}
|
||||
return resolve(response)
|
||||
}))
|
||||
.then(response => new Promise(resolve => resolve(response.data)))
|
||||
};
|
||||
|
||||
const RequestError = (code, msg, data) => {
|
||||
const description = msg ? `- ${msg}` : '';
|
||||
|
||||
this.name = 'RequestError';
|
||||
this.message = `API returned: ${code}${description}.`;
|
||||
this.code = code;
|
||||
this.description = msg;
|
||||
this.data = data;
|
||||
};
|
||||
|
||||
RequestError.prototype = Object.create(Error.prototype);
|
||||
RequestError.prototype.constructor = RequestError;
|
||||
|
@ -1,11 +1,11 @@
|
||||
import React, {useState} from 'react'
|
||||
import React, {useEffect, useState} from 'react'
|
||||
import {Link, useNavigate} from 'react-router-dom'
|
||||
import {useDispatch, useSelector} from 'react-redux'
|
||||
import {withSwalInstance} from 'sweetalert2-react'
|
||||
import swal from 'sweetalert2'
|
||||
|
||||
import {Loader} from '../Loader/Loader'
|
||||
import ErrorBoundary from "../../hoc/ErrorBoundary";
|
||||
import ErrorBoundary from "../../HOC/ErrorBoundary";
|
||||
|
||||
import {auth, selectAuth, setUserInfo} from '../../redux/outstaffingSlice'
|
||||
import {loading} from '../../redux/loaderSlice'
|
||||
@ -13,7 +13,7 @@ import {setRole} from '../../redux/roleSlice'
|
||||
|
||||
import {selectIsLoading} from '../../redux/loaderSlice'
|
||||
|
||||
import {useRequest} from "../../hooks/useRequest";
|
||||
import {apiRequest} from "../../api/request";
|
||||
|
||||
import ellipse from '../../images/ellipse.png'
|
||||
|
||||
@ -30,7 +30,6 @@ export const AuthBox = ({title, altTitle, roleChangeLink}) => {
|
||||
const isAuth = useSelector(selectAuth);
|
||||
const isLoading = useSelector(selectIsLoading);
|
||||
|
||||
const {apiRequest} = useRequest();
|
||||
|
||||
const [username, setUsername] = useState('');
|
||||
const [password, setPassword] = useState('');
|
||||
@ -40,6 +39,12 @@ export const AuthBox = ({title, altTitle, roleChangeLink}) => {
|
||||
navigate('/')
|
||||
}
|
||||
|
||||
useEffect(()=> {
|
||||
if (!localStorage.getItem('auth_token')) {
|
||||
dispatch(auth(false))
|
||||
}
|
||||
}, []);
|
||||
|
||||
const submitHandler = () => {
|
||||
|
||||
if (!isLoading) {
|
||||
|
@ -8,7 +8,7 @@ import {Footer} from '../Footer/Footer'
|
||||
|
||||
import {currentCandidate, selectCurrentCandidate,} from '../../redux/outstaffingSlice'
|
||||
|
||||
import {useRequest} from "../../hooks/useRequest";
|
||||
import {apiRequest} from "../../api/request";
|
||||
import {createMarkup} from "../../helper";
|
||||
|
||||
import arrow from '../../images/right-arrow.png'
|
||||
@ -33,7 +33,7 @@ const Candidate = () => {
|
||||
|
||||
const [activeSnippet, setActiveSnippet] = useState(true);
|
||||
|
||||
const {apiRequest} = useRequest();
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
window.scrollTo(0, 0)
|
||||
|
@ -3,11 +3,13 @@ import {useSelector} from 'react-redux'
|
||||
import {Link} from 'react-router-dom'
|
||||
|
||||
import {Loader} from '../Loader/Loader'
|
||||
import ErrorBoundary from "../../hoc/ErrorBoundary";
|
||||
import ErrorBoundary from "../../HOC/ErrorBoundary";
|
||||
|
||||
import {LEVELS, SKILLS} from '../../constants/constants'
|
||||
import {selectProfiles, selectFilteredCandidates,} from '../../redux/outstaffingSlice'
|
||||
|
||||
import {urlForLocal} from '../../helper'
|
||||
|
||||
import male from '../../images/medium_male.png'
|
||||
import rectangle from '../../images/rectangle_secondPage.png'
|
||||
|
||||
@ -20,6 +22,7 @@ const Description = ({onLoadMore, isLoadingMore}) => {
|
||||
const filteredListArr = useSelector(selectFilteredCandidates);
|
||||
|
||||
|
||||
|
||||
if (!filteredListArr) {
|
||||
return (
|
||||
<section className='description'>
|
||||
@ -30,7 +33,7 @@ const Description = ({onLoadMore, isLoadingMore}) => {
|
||||
candidatesListArr.map((el) => (
|
||||
<div className='row' key={el.id}>
|
||||
<div className='col-2 col-xs-12'>
|
||||
<img className='description__img' src={el.photo} alt=''/>
|
||||
<img className='description__img' src={urlForLocal(el.photo)} alt=''/>
|
||||
</div>
|
||||
<div className='col-12 col-xl-6'>
|
||||
<h3 className='description__title'>
|
||||
@ -114,7 +117,7 @@ const Description = ({onLoadMore, isLoadingMore}) => {
|
||||
? filteredListArr.map((el) => (
|
||||
<div className='row' key={el.id}>
|
||||
<div className='col-2'>
|
||||
<img className='description__img' src={el.photo} alt=''/>
|
||||
<img className='description__img' src={()=>urlForLocal(el?.photo)} alt=''/>
|
||||
</div>
|
||||
<div className='col-12 col-xl-6'>
|
||||
<h3 className='description__title'>
|
||||
|
@ -7,7 +7,7 @@ import './form.scss'
|
||||
|
||||
import { withSwalInstance } from 'sweetalert2-react'
|
||||
import swal from 'sweetalert2'
|
||||
import {useRequest} from "../../hooks/useRequest";
|
||||
import {apiRequest} from "../../api/request";
|
||||
|
||||
|
||||
const SweetAlert = withSwalInstance(swal);
|
||||
@ -25,7 +25,6 @@ const Form = () => {
|
||||
});
|
||||
const [isFetching, setIsFetching] = useState(false);
|
||||
|
||||
const {apiRequest} = useRequest();
|
||||
|
||||
const handleChange = (e) => {
|
||||
const { id, value } = e.target;
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
filteredCandidates,
|
||||
} from '../../redux/outstaffingSlice'
|
||||
|
||||
import {useRequest} from "../../hooks/useRequest";
|
||||
import {apiRequest} from "../../api/request";
|
||||
|
||||
import './outstaffingBlock.scss'
|
||||
|
||||
@ -57,7 +57,6 @@ const OutstaffingBlock = (
|
||||
|
||||
const itemsArr = useSelector(selectItems);
|
||||
|
||||
const {apiRequest} = useRequest();
|
||||
|
||||
const handleBlockClick = (item, id) => {
|
||||
if (!itemsArr.find((el) => item === el.value)) {
|
||||
|
@ -9,12 +9,15 @@ import {ProfileCalendarComponent} from "./ProfileCalendarComponent";
|
||||
import { Footer } from '../Footer/Footer'
|
||||
import {ProfileHeader} from "../ProfileHeader/ProfileHeader";
|
||||
|
||||
import {useRequest} from "../../hooks/useRequest";
|
||||
import {urlForLocal} from "../../helper";
|
||||
|
||||
import {apiRequest} from "../../api/request";
|
||||
import { getProfileInfo } from '../../redux/outstaffingSlice'
|
||||
import {setReportDate} from "../../redux/reportSlice";
|
||||
|
||||
import './profileCalendar.scss'
|
||||
|
||||
|
||||
export const ProfileCalendar = () => {
|
||||
const dispatch = useDispatch();
|
||||
const profileInfo = useSelector(getProfileInfo);
|
||||
@ -23,13 +26,12 @@ export const ProfileCalendar = () => {
|
||||
const [totalHours, setTotalHours] = useState(0);
|
||||
const [requestDates, setRequestDates] = useState('');
|
||||
|
||||
const {apiRequest} = useRequest();
|
||||
|
||||
useEffect(() => {
|
||||
setRequestDates(getReports(moment()))
|
||||
});
|
||||
},[]);
|
||||
|
||||
useEffect(async () => {
|
||||
useEffect( () => {
|
||||
if (!requestDates) {
|
||||
return
|
||||
}
|
||||
@ -57,7 +59,7 @@ export const ProfileCalendar = () => {
|
||||
<h2 className='summary__title'>Ваши отчеты</h2>
|
||||
<div className='summary__info'>
|
||||
<div className='summary__person'>
|
||||
<img src={profileInfo.photo} className='summary__avatar' alt='avatar'/>
|
||||
<img src={urlForLocal(profileInfo.photo)} className='summary__avatar' alt='avatar'/>
|
||||
<p className='summary__name'>{profileInfo.fio} {profileInfo.specification}</p>
|
||||
</div>
|
||||
<Link to='/report'>
|
||||
|
@ -3,21 +3,21 @@ import {useNavigate, NavLink} from "react-router-dom";
|
||||
import {useDispatch, useSelector} from "react-redux";
|
||||
|
||||
import {Loader} from '../Loader/Loader'
|
||||
|
||||
import {apiRequest} from "../../api/request";
|
||||
import {auth, getProfileInfo, setProfileInfo} from "../../redux/outstaffingSlice";
|
||||
import {getRole} from "../../redux/roleSlice";
|
||||
|
||||
|
||||
import {urlForLocal} from "../../helper";
|
||||
|
||||
import './profileHeader.scss'
|
||||
import {useRequest} from "../../hooks/useRequest";
|
||||
|
||||
|
||||
|
||||
|
||||
export const ProfileHeader = () => {
|
||||
const navigate = useNavigate();
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const {apiRequest} = useRequest();
|
||||
|
||||
const userRole = useSelector(getRole);
|
||||
const profileInfo = useSelector(getProfileInfo);
|
||||
@ -61,8 +61,8 @@ export const ProfileHeader = () => {
|
||||
</nav>
|
||||
|
||||
<div className='profileHeader__personalInfo'>
|
||||
<h3 className='profileHeader__personalInfoName'>{profileInfo.fio}</h3>
|
||||
<img src={profileInfo.photo} className='profileHeader__personalInfoAvatar' alt='avatar'/>
|
||||
<h3 className='profileHeader__personalInfoName'>{profileInfo?.fio}</h3>
|
||||
<img src={profileInfo.photo ? urlForLocal(profileInfo.photo) : ""} className='profileHeader__personalInfoAvatar' alt='avatar'/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -7,7 +7,7 @@ import {currentMonthAndDay} from '../Calendar/calendarHelper'
|
||||
import {Footer} from "../Footer/Footer";
|
||||
import {ProfileHeader} from "../ProfileHeader/ProfileHeader";
|
||||
|
||||
import {useRequest} from "../../hooks/useRequest";
|
||||
import {apiRequest} from "../../api/request";
|
||||
|
||||
import {getReportDate} from '../../redux/reportSlice'
|
||||
|
||||
@ -35,7 +35,6 @@ const getCreatedDate = (day) => {
|
||||
const ReportForm = () => {
|
||||
const reportDate = useSelector(getReportDate);
|
||||
|
||||
const {apiRequest} = useRequest();
|
||||
const [isFetching, setIsFetching] = useState(false);
|
||||
const [reportSuccess, setReportSuccess] = useState(false);
|
||||
|
||||
|
@ -2,7 +2,7 @@ import React, {useState} from 'react'
|
||||
import {useSelector, useDispatch} from 'react-redux'
|
||||
import Select from 'react-select'
|
||||
import {Loader} from '../Loader/Loader'
|
||||
import {useRequest} from "../../hooks/useRequest";
|
||||
import {apiRequest} from "../../api/request";
|
||||
import {
|
||||
selectedItems,
|
||||
selectItems,
|
||||
@ -19,7 +19,6 @@ const TagSelect = () => {
|
||||
const [searchLoading, setSearchLoading] = useState(false);
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const {apiRequest} = useRequest();
|
||||
|
||||
const itemsArr = useSelector(selectItems);
|
||||
const tagsArr = useSelector(selectTags);
|
||||
|
@ -6,9 +6,9 @@ import {BookkeepingFormField} from "../BookkeepingFormField/BookkeepingFormField
|
||||
import {BookkepingSelect} from '../BookkepingSelect/BookkepingSelect';
|
||||
import {BookkepingInput} from '../BookkepingInput/BookkepingInput';
|
||||
|
||||
import {useRequest} from "../../../../hooks/useRequest";
|
||||
|
||||
import "./actContent.css"
|
||||
import {apiRequest} from "../../../../api/request";
|
||||
|
||||
export const ActContent = () => {
|
||||
|
||||
@ -16,7 +16,6 @@ export const ActContent = () => {
|
||||
const [selectedTemplate, setSelectedTemplate] = useState();
|
||||
const [templatedFields, setTemplatedFields] = useState([]);
|
||||
|
||||
const {apiRequest} = useRequest();
|
||||
|
||||
useEffect(() => {
|
||||
apiRequest('/template/get-template-list')
|
||||
|
@ -5,7 +5,6 @@ import {BookkeepingFormField} from "../BookkeepingFormField/BookkeepingFormField
|
||||
import {BookkepingSelect} from '../BookkepingSelect/BookkepingSelect';
|
||||
import {BookkepingInput} from '../BookkepingInput/BookkepingInput';
|
||||
import {Link} from "react-router-dom"
|
||||
import {useRequest} from "../../../../hooks/useRequest";
|
||||
|
||||
export const ContractContent = () => {
|
||||
|
||||
@ -13,7 +12,6 @@ export const ContractContent = () => {
|
||||
const [selectedTemplate, setSelectedTemplate] = useState();
|
||||
const [templatedFields, setTemplatedFields] = useState([]);
|
||||
|
||||
const {apiRequest} = useRequest();
|
||||
|
||||
useEffect(() => {
|
||||
apiRequest(`/document/get-document-list`)
|
||||
|
@ -1,8 +1,8 @@
|
||||
import React, {useEffect} from 'react'
|
||||
import {useDispatch, useSelector} from 'react-redux'
|
||||
import {selectUserInfo, setQuestionnairesList, setUserInfo} from "../../../redux/quizSlice";
|
||||
import {useRequest} from "../../../hooks/useRequest";
|
||||
import './quiz.scss'
|
||||
import {apiRequest} from "../../../api/request";
|
||||
|
||||
export const HeaderQuiz = ({header}) => {
|
||||
|
||||
@ -10,7 +10,6 @@ export const HeaderQuiz = ({header}) => {
|
||||
const userId = localStorage.getItem('id');
|
||||
const userInfo = useSelector(selectUserInfo);
|
||||
|
||||
const {apiRequest} = useRequest();
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(setUserInfo(userId))
|
||||
|
@ -5,14 +5,14 @@ import {useEffect, useState} from "react";
|
||||
import {useSelector} from "react-redux";
|
||||
import {selectedTest} from "../../../redux/quizSlice";
|
||||
|
||||
import {useRequest} from "../../../hooks/useRequest";
|
||||
import {useRequest} from "../../../HOOks/useRequest";
|
||||
import {apiRequest} from "../../../api/request";
|
||||
|
||||
export const Instruction = () => {
|
||||
|
||||
const [countQuestions, setCountQuestions] = useState(null);
|
||||
const test = useSelector(selectedTest);
|
||||
|
||||
const {apiRequest} = useRequest();
|
||||
|
||||
useEffect( () => {
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
import React, {useEffect, useState} from 'react';
|
||||
import {useDispatch, useSelector} from "react-redux";
|
||||
import {fetchResultTest, selectedTest, selectResult} from "../../../redux/quizSlice";
|
||||
import {useRequest} from "../../../hooks/useRequest";
|
||||
import {useRequest} from "../../../HOOks/useRequest";
|
||||
import {apiRequest} from "../../../api/request";
|
||||
|
||||
|
||||
export const Results = () => {
|
||||
@ -9,7 +10,6 @@ export const Results = () => {
|
||||
const test = useSelector(selectedTest);
|
||||
const [maxScore, setMaxScore] = useState('');
|
||||
const dispatch = useDispatch();
|
||||
const {apiRequest} = useRequest();
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(fetchResultTest(test.uuid));
|
||||
|
@ -2,7 +2,7 @@ import React, {useEffect, useState} from 'react'
|
||||
import {useNavigate} from "react-router-dom"
|
||||
import {useSelector, useDispatch} from 'react-redux'
|
||||
|
||||
import {useRequest} from "../../../hooks/useRequest";
|
||||
import {useRequest} from "../../../HOOks/useRequest";
|
||||
import {Progressbar} from './ProgressbarQuiz'
|
||||
import {GetOptionTask} from './GetOptionTask'
|
||||
|
||||
@ -11,6 +11,7 @@ import {
|
||||
} from './../../../redux/quizSlice'
|
||||
|
||||
import './quiz.scss'
|
||||
import {apiRequest} from "../../../api/request";
|
||||
|
||||
export const TaskQuiz = () => {
|
||||
|
||||
@ -26,7 +27,6 @@ export const TaskQuiz = () => {
|
||||
const [inputValue, setInputValue] = useState('');
|
||||
const [questions, setQuestions] = useState([]);
|
||||
|
||||
const {apiRequest} = useRequest();
|
||||
|
||||
const id = localStorage.getItem('id');
|
||||
|
||||
|
@ -35,3 +35,6 @@ export const getToken = () => {
|
||||
};
|
||||
|
||||
export const urlHasParams = (url) => url.indexOf('?') > 0 ? `${url}&${window.location.search.substr(1)}` : `${url}${window.location.search}`;
|
||||
|
||||
|
||||
export const urlForLocal = (url) => process.env.NODE_ENV === 'development' ? `https://itguild.info${url}` : url;
|
@ -1,61 +0,0 @@
|
||||
import axios from 'axios';
|
||||
import {getToken, urlHasParams} from "../helper";
|
||||
import {useLogout} from "./useLogout";
|
||||
|
||||
|
||||
const instance = axios.create({
|
||||
baseURL: process.env.REACT_APP_API_URL,
|
||||
validateStatus(status) {
|
||||
return status;
|
||||
},
|
||||
});
|
||||
|
||||
export const useRequest = () => {
|
||||
|
||||
|
||||
const {logout} = useLogout();
|
||||
|
||||
const apiRequest = (url, {
|
||||
method = 'get', params, data,
|
||||
headers = {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
} = {}) => {
|
||||
const fullHeaders = {...headers, ...getToken()};
|
||||
let urWithParams = urlHasParams(url);
|
||||
|
||||
|
||||
return instance
|
||||
.request({
|
||||
url: urWithParams,
|
||||
method,
|
||||
params,
|
||||
data,
|
||||
headers: {...fullHeaders},
|
||||
})
|
||||
.then(response => new Promise(resolve => {
|
||||
if (response.data.redirect || response.status === 401) {
|
||||
logout()
|
||||
}
|
||||
return resolve(response)
|
||||
}))
|
||||
.then(response => new Promise(resolve => resolve(response.data)))
|
||||
};
|
||||
|
||||
const RequestError = (code, msg, data) => {
|
||||
const description = msg ? `- ${msg}` : '';
|
||||
|
||||
this.name = 'RequestError';
|
||||
this.message = `API returned: ${code}${description}.`;
|
||||
this.code = code;
|
||||
this.description = msg;
|
||||
this.data = data;
|
||||
};
|
||||
|
||||
RequestError.prototype = Object.create(Error.prototype);
|
||||
RequestError.prototype.constructor = RequestError;
|
||||
|
||||
|
||||
return {apiRequest}
|
||||
};
|
@ -8,6 +8,7 @@ import authImg from '../../images/auth_img.png'
|
||||
import cross from '../../images/cross.png'
|
||||
import text from '../../images/Body_Text.png'
|
||||
import vector from '../../images/Vector_Smart_Object.png'
|
||||
import vectorBlack from '../../images/Vector_Smart_Object_black.png'
|
||||
|
||||
import { selectAuth } from '../../redux/outstaffingSlice'
|
||||
import { useNavigate} from 'react-router-dom'
|
||||
@ -30,7 +31,7 @@ const AuthForDevelopers = () => {
|
||||
<img className='auth-developers__vector' src={vector} alt='' />
|
||||
<img
|
||||
className='auth-developers__vector-black'
|
||||
src={'./images/Vector_Smart_Object_black.png'}
|
||||
src={vectorBlack}
|
||||
alt=''
|
||||
/>
|
||||
<div className='container'>
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { WithLogout } from '../hoc/withLogout';
|
||||
import { WithLogout } from '../HOC/withLogout';
|
||||
import Calendar from '../components/Calendar/Calendar';
|
||||
|
||||
const CalendarPage = () => {
|
||||
|
@ -3,8 +3,8 @@ import {useDispatch, useSelector} from 'react-redux'
|
||||
import {useParams, useNavigate} from 'react-router-dom'
|
||||
import SVG from 'react-inlinesvg'
|
||||
|
||||
import {useRequest} from "../../hooks/useRequest";
|
||||
import {WithLogout} from '../../hoc/withLogout'
|
||||
import {useRequest} from "../../HOOks/useRequest";
|
||||
import {WithLogout} from '../../HOC/withLogout'
|
||||
|
||||
import Form from '../../components/Form/Form'
|
||||
import {Footer} from '../../components/Footer/Footer'
|
||||
@ -18,6 +18,7 @@ import {LEVELS, SKILLS} from '../../constants/constants'
|
||||
import {currentCandidate, selectCurrentCandidate} from '../../redux/outstaffingSlice'
|
||||
|
||||
import './formPage.scss'
|
||||
import {apiRequest} from "../../api/request";
|
||||
|
||||
|
||||
|
||||
@ -29,7 +30,6 @@ const FormPage = () => {
|
||||
const candidate = useSelector(selectCurrentCandidate);
|
||||
|
||||
|
||||
const {apiRequest} = useRequest();
|
||||
|
||||
const goBack = () => {
|
||||
navigate(-1)
|
||||
|
@ -7,9 +7,10 @@ import {Footer} from '../../components/Footer/Footer'
|
||||
|
||||
import {profiles, tags} from '../../redux/outstaffingSlice'
|
||||
|
||||
import {useRequest} from "../../hooks/useRequest";
|
||||
import {useRequest} from "../../HOOks/useRequest";
|
||||
import {LogoutButton} from "../../components/LogoutButton/LogoutButton";
|
||||
import {Header} from "../../components/Header/Header";
|
||||
import {apiRequest} from "../../api/request";
|
||||
|
||||
|
||||
const Home = () => {
|
||||
@ -19,8 +20,6 @@ const Home = () => {
|
||||
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const {apiRequest} = useRequest();
|
||||
|
||||
useEffect(() => {
|
||||
setIsLoadingMore(true);
|
||||
apiRequest('/profile', {
|
||||
|
@ -7,11 +7,14 @@ import {Footer} from "../../components/Footer/Footer";
|
||||
|
||||
import {getProfileInfo} from "../../redux/outstaffingSlice";
|
||||
|
||||
import {urlForLocal} from "../../helper";
|
||||
|
||||
import reportsIcon from "../../images/reports.png"
|
||||
import summaryIcon from "../../images/summaryIcon.png"
|
||||
import timerIcon from "../../images/timerIcon.png"
|
||||
import paymentIcon from "../../images/paymentIcon.png"
|
||||
import settingIcon from "../../images/settingIcon.png"
|
||||
|
||||
import rightArrow from "../../images/arrowRight.png"
|
||||
|
||||
import './profile.scss'
|
||||
@ -27,7 +30,7 @@ export const Profile = () => {
|
||||
<h2 className='profile__title'>Добрый день, <span>{profileInfo.fio}</span></h2>
|
||||
<div className='summary__info'>
|
||||
<div className='summary__person'>
|
||||
<img src={profileInfo.photo} className='summary__avatar' alt='avatar'/>
|
||||
<img src={profileInfo.photo ? urlForLocal(profileInfo.photo) : ''} className='summary__avatar' alt='avatar'/>
|
||||
<p className='summary__name'>{profileInfo.fio} {profileInfo.specification}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react'
|
||||
import { WithLogout } from '../../hoc/withLogout'
|
||||
import { WithLogout } from '../../HOC/withLogout'
|
||||
import arrowLeft from '../../images/right-arrow.png'
|
||||
|
||||
import SVG from 'react-inlinesvg'
|
||||
|
@ -3,22 +3,22 @@ import {useSelector} from "react-redux";
|
||||
import {ProfileHeader} from "../../components/ProfileHeader/ProfileHeader";
|
||||
import {getProfileInfo} from "../../redux/outstaffingSlice";
|
||||
import {Footer} from '../../components/Footer/Footer'
|
||||
import {transformHtml} from "../../helper";
|
||||
import {transformHtml, urlForLocal} from "../../helper";
|
||||
|
||||
import {useRequest} from "../../hooks/useRequest";
|
||||
import {useRequest} from "../../HOOks/useRequest";
|
||||
|
||||
import arrow from "../../images/right-arrow.png";
|
||||
import rightArrow from "../../images/arrowRight.png"
|
||||
import gitImgItem from "../../images/gitItemImg.png"
|
||||
|
||||
import './summary.scss'
|
||||
import {apiRequest} from "../../api/request";
|
||||
|
||||
export const Summary = () => {
|
||||
const profileInfo = useSelector(getProfileInfo);
|
||||
const [openGit, setOpenGit] = useState(false);
|
||||
const [gitInfo, setGitInfo] = useState([]);
|
||||
|
||||
const {apiRequest} = useRequest();
|
||||
useEffect(() => {
|
||||
apiRequest(`/profile/portfolio-projects?card_id=${localStorage.getItem('cardId')}`)
|
||||
.then(responseGit => setGitInfo(responseGit))
|
||||
@ -35,7 +35,7 @@ export const Summary = () => {
|
||||
</div>}
|
||||
<div className='summary__info'>
|
||||
<div className='summary__person'>
|
||||
<img src={profileInfo.photo} className='summary__avatar' alt='avatar'/>
|
||||
<img src={urlForLocal(profileInfo.photo)} className='summary__avatar' alt='avatar'/>
|
||||
<p className='summary__name'>{profileInfo.fio} {profileInfo.specification}</p>
|
||||
</div>
|
||||
{!openGit &&
|
||||
|
Reference in New Issue
Block a user