Переписываю спорные решения

This commit is contained in:
Дмитрий Савенко 2023-01-16 19:57:55 +03:00
parent 794a5fa44e
commit 549e0eac74
11 changed files with 51 additions and 87 deletions

View File

@ -6,7 +6,7 @@ export const Achievement = ({ achievement }) => {
return ( return (
<div className='achievement'> <div className='achievement'>
<div className='achievement__icon'> <div className='achievement__icon'>
<img src={achievement.img} /> <img src={achievement.img} alt='achievement' />
</div> </div>
<div className='achievement__popup'> <div className='achievement__popup'>
<div className='achievement__title'>{achievement.title}</div> <div className='achievement__title'>{achievement.title}</div>

View File

@ -1,31 +1,30 @@
import React, {useEffect} from 'react' import React, {useEffect, useState} from 'react'
import {useParams, Link, useNavigate} from 'react-router-dom' import {useParams, Link, useNavigate} from 'react-router-dom'
import {useSelector, useDispatch} from 'react-redux' import {useSelector, useDispatch} from 'react-redux'
import {
currentCandidate, import SkillSection from '../SkillSection/SkillSection'
selectCurrentCandidate, import Sidebar from '../CandidateSidebar/CandidateSidebar'
} from '../../redux/outstaffingSlice' import {Footer} from '../Footer/Footer'
import {getRole} from '../../redux/roleSlice'
import {useState} from 'react' import {currentCandidate, selectCurrentCandidate,} from '../../redux/outstaffingSlice'
import {useRequest} from "../../hooks/useRequest";
import {createMarkup} from "../../helper"; import {createMarkup} from "../../helper";
import arrow from '../../images/right-arrow.png' import arrow from '../../images/right-arrow.png'
import rectangle from '../../images/rectangle_secondPage.png' import rectangle from '../../images/rectangle_secondPage.png'
import Sidebar from '../CandidateSidebar/CandidateSidebar'
import SkillSection from '../SkillSection/SkillSection'
import front from '../../images/front_end.png' import front from '../../images/front_end.png'
import back from '../../images/back_end.png' import back from '../../images/back_end.png'
import design from '../../images/design.png' import design from '../../images/design.png'
import {Footer} from '../Footer/Footer'
import './candidate.scss' import './candidate.scss'
import {useRequest} from "../../hooks/useRequest";
const Candidate = () => { const Candidate = () => {
const {id: candidateId} = useParams(); const {id: candidateId} = useParams();
const navigate = useNavigate(); const navigate = useNavigate();
const dispatch = useDispatch(); const dispatch = useDispatch();
const role = useSelector(getRole);
const [activeSnippet, setActiveSnippet] = useState(true); const [activeSnippet, setActiveSnippet] = useState(true);
const {apiRequest} = useRequest(); const {apiRequest} = useRequest();
@ -136,20 +135,13 @@ const Candidate = () => {
: 'Описание отсутствует...'} : 'Описание отсутствует...'}
</p> </p>
)} )}
{/* <Link to={`/candidate/${currentCandidateObj.id}/form`}>
<button type="submit" className='candidate__btn'>
Выбрать к собеседованию
</button>
</Link> */}
<SkillSection skillsArr={skillValues}/> <SkillSection skillsArr={skillValues}/>
</div> </div>
</div> </div>
) : ) :
( (
// <div className="col-12 col-xl-8">
// <CodeSnippetlighter />
// </div>
<div className="col-12 col-xl-8"> <div className="col-12 col-xl-8">
<div className="candidate__works works"> <div className="candidate__works works">
<div className="works__body"> <div className="works__body">

View File

@ -1,42 +1,21 @@
import React, { useEffect, useState } from 'react' import React from 'react'
import male from '../../images/medium_male.png' import {useSelector} from 'react-redux'
import rectangle from '../../images/rectangle_secondPage.png'
import {Link} from 'react-router-dom' import {Link} from 'react-router-dom'
import { LEVELS, SKILLS } from '../../constants/constants'
import {
selectProfiles,
selectFilteredCandidates,
selectItems,
} from '../../redux/outstaffingSlice'
import { useSelector, useDispatch } from 'react-redux'
import {Loader} from '../Loader/Loader' import {Loader} from '../Loader/Loader'
import { getRole } from '../../redux/roleSlice'
import {LEVELS, SKILLS} from '../../constants/constants'
import {selectProfiles, selectFilteredCandidates,} from '../../redux/outstaffingSlice'
import male from '../../images/medium_male.png'
import rectangle from '../../images/rectangle_secondPage.png'
import './description.scss' import './description.scss'
import {useRequest} from "../../hooks/useRequest";
const Description = ({ onLoadMore, isLoadingMore }) => { const Description = ({ onLoadMore, isLoadingMore }) => {
const dispatch = useDispatch();
const {apiRequest} = useRequest();
const [isLoaded, setIsLoaded] = useState(false);
const role = useSelector(getRole);
const candidatesListArr = useSelector(selectProfiles);
const itemsArr = useSelector(selectItems);
const filteredListArr = useSelector(selectFilteredCandidates);
const [allCandidates, getAllCandidates] = useState([]);
// useEffect(() => { const candidatesListArr = useSelector(selectProfiles);
// apiRequest('/profile?limit=',{ const filteredListArr = useSelector(selectFilteredCandidates);
// params: 1000,
//
// role,
// logout: () => dispatch(auth(false))
// }).then((p) => {
// getAllCandidates(p);
// setIsLoaded(true)
// })
// }, []);
if (!filteredListArr) { if (!filteredListArr) {
return ( return (
@ -94,7 +73,7 @@ const Description = ({ onLoadMore, isLoadingMore }) => {
)) ))
) : ( ) : (
<div className='description__empty'> <div className='description__empty'>
{isLoaded {isLoadingMore
? 'В данный момент в категории нет свободных специалистов' ? 'В данный момент в категории нет свободных специалистов'
: 'Загрузка...'} : 'Загрузка...'}
</div> </div>
@ -228,9 +207,8 @@ const Description = ({ onLoadMore, isLoadingMore }) => {
<div className='col-12'> <div className='col-12'>
<div className='description__footer'> <div className='description__footer'>
<div className='description__footer-btn'> <div className='description__footer-btn'>
{allCandidates && {
candidatesListArr && candidatesListArr &&
candidatesListArr.length !== allCandidates.length &&
filteredListArr.length === 0 ? ( filteredListArr.length === 0 ? (
<button onClick={() => onLoadMore(2)}>Загрузить еще</button> <button onClick={() => onLoadMore(2)}>Загрузить еще</button>
) : null} ) : null}

View File

@ -1,18 +1,15 @@
import React, {useState, useEffect} from 'react' import React, {useState, useEffect} from 'react'
import {useDispatch, useSelector} from 'react-redux' import {useDispatch} from 'react-redux'
import Outstaffing from '../Outstaffing/Outstaffing' import Outstaffing from '../Outstaffing/Outstaffing'
import Description from '../Description/Description' import Description from '../Description/Description'
import {Footer} from '../Footer/Footer' import {Footer} from '../Footer/Footer'
import {profiles, tags} from '../../redux/outstaffingSlice'
import {profiles, tags, auth} from '../../redux/outstaffingSlice'
import {getRole} from '../../redux/roleSlice'
import {useRequest} from "../../hooks/useRequest"; import {useRequest} from "../../hooks/useRequest";
const Home = () => { const Home = () => {
const [isLoadingMore, setIsLoadingMore] = useState(false); const [isLoadingMore, setIsLoadingMore] = useState(false);
@ -48,7 +45,8 @@ const Home = () => {
); );
dispatch(tags(tempTags)) dispatch(tags(tempTags))
}) })
}, [dispatch, index]); console.log(1)
}, [index]);
const loadMore = (count) => { const loadMore = (count) => {
setIndex((prev) => prev + count) setIndex((prev) => prev + count)

View File

@ -1,12 +1,11 @@
import React, { useState } from 'react' import React from 'react'
import { useSelector, useDispatch } from 'react-redux' import { useSelector, useDispatch } from 'react-redux'
import OutstaffingBlock from '../OutstaffingBlock/OutstaffingBlock' import OutstaffingBlock from '../OutstaffingBlock/OutstaffingBlock'
import TagSelect from '../Select/TagSelect' import TagSelect from '../Select/TagSelect'
import {
selectTags, import { selectTags, getPositionId, setPositionId} from '../../redux/outstaffingSlice'
getPositionId,
setPositionId
} from '../../redux/outstaffingSlice'
import front from '../../images/front_end.png' import front from '../../images/front_end.png'
import back from '../../images/back_end.png' import back from '../../images/back_end.png'
import design from '../../images/design.png' import design from '../../images/design.png'

View File

@ -1,20 +1,19 @@
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import {useDispatch, useSelector} from 'react-redux' import {useSelector} from 'react-redux'
import { getProfileInfo } from '../../redux/outstaffingSlice'
import { setReportDate } from '../../redux/reportSlice';
import arrow from "../../images/right-arrow.png";
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
import moment from "moment"; import moment from "moment";
import rectangle from '../../images/rectangle_secondPage.png'
import {currentMonth, getReports} from '../Calendar/calendarHelper' import {currentMonth, getReports} from '../Calendar/calendarHelper'
import {ProfileCalendarComponent} from "./ProfileCalendarComponent"; import {ProfileCalendarComponent} from "./ProfileCalendarComponent";
import { ProfileHeader } from "../Profile/ProfileHeader";
import { Footer } from '../Footer/Footer' import { Footer } from '../Footer/Footer'
import {ProfileHeader} from "../ProfileHeader/ProfileHeader";
import {useRequest} from "../../hooks/useRequest";
import { getProfileInfo } from '../../redux/outstaffingSlice'
import './profileCalendar.scss' import './profileCalendar.scss'
import {useRequest} from "../../hooks/useRequest";
export const ProfileCalendar = () => { export const ProfileCalendar = () => {
const dispatch = useDispatch();
const profileInfo = useSelector(getProfileInfo); const profileInfo = useSelector(getProfileInfo);
const [month, setMonth] = useState(''); const [month, setMonth] = useState('');
const [reports, setReports] = useState([]); const [reports, setReports] = useState([]);

View File

@ -8,12 +8,11 @@ import ellipse from '../../images/ellipse.png'
import remove from '../../images/remove.png' import remove from '../../images/remove.png'
import addIcon from '../../images/addIcon.png' import addIcon from '../../images/addIcon.png'
import {currentMonthAndDay} from '../Calendar/calendarHelper' import {currentMonthAndDay} from '../Calendar/calendarHelper'
import {currentMonthAndDay, getReports} from '../Calendar/calendarHelper'
import {ProfileHeader} from "../Profile/ProfileHeader";
import {Footer} from "../Footer/Footer"; import {Footer} from "../Footer/Footer";
import './reportForm.scss' import './reportForm.scss'
import arrow from "../../images/right-arrow.png"; import arrow from "../../images/right-arrow.png";
import {useRequest} from "../../hooks/useRequest"; import {useRequest} from "../../hooks/useRequest";
import {ProfileHeader} from "../ProfileHeader/ProfileHeader";
const getCreatedDate = (day) => { const getCreatedDate = (day) => {
if (day) { if (day) {

View File

@ -1,5 +1,4 @@
import { Link } from 'react-router-dom' import React from 'react'
import avatar from './../../../images/medium_male.png'
import './quiz.scss' import './quiz.scss'
export const Progressbar = ({indexQuestion, width}) => { export const Progressbar = ({indexQuestion, width}) => {
@ -15,4 +14,4 @@ export const Progressbar = ({indexQuestion, width}) => {
</div> </div>
</div> </div>
) )
} };

View File

@ -11,12 +11,12 @@ export const Results = () => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const {apiRequest} = useRequest(); const {apiRequest} = useRequest();
useEffect(async () => { useEffect(() => {
dispatch(fetchResultTest(test.uuid)); dispatch(fetchResultTest(test.uuid));
apiRequest(`/user-questionnaire/get-points-number?user_questionnaire_uuid=${test.uuid}`) apiRequest(`/user-questionnaire/get-points-number?user_questionnaire_uuid=${test.uuid}`)
.then((res) => setMaxScore(res.sum_point)); .then((res) => setMaxScore(res.sum_point));
}, []); }, [apiRequest, dispatch, test]);
return ( return (
<div className={'result _container'}> <div className={'result _container'}>

View File

@ -38,7 +38,7 @@ export const TaskQuiz = () => {
dispatch(fetchGetAnswers(response[0].id)); dispatch(fetchGetAnswers(response[0].id));
setStripValue((+index + 1) * 100 / response.length) setStripValue((+index + 1) * 100 / response.length)
}) })
}, [dispatch, apiRequest]); }, [dispatch]);
const nextQuestion = async (e) => { const nextQuestion = async (e) => {
e.preventDefault(); e.preventDefault();

View File

@ -22,7 +22,7 @@ export const Summary = () => {
useEffect(() => { useEffect(() => {
apiRequest(`/profile/portfolio-projects?card_id=${localStorage.getItem('cardId')}`) apiRequest(`/profile/portfolio-projects?card_id=${localStorage.getItem('cardId')}`)
.then(responseGit => setGitInfo(responseGit)) .then(responseGit => setGitInfo(responseGit))
}, [apiRequest]); }, []);
return ( return (
<div className='summary'> <div className='summary'>
<ProfileHeader/> <ProfileHeader/>