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

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

View File

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

View File

@ -1,18 +1,15 @@
import React, {useState, useEffect} from 'react'
import {useDispatch, useSelector} from 'react-redux'
import {useDispatch} from 'react-redux'
import Outstaffing from '../Outstaffing/Outstaffing'
import Description from '../Description/Description'
import {Footer} from '../Footer/Footer'
import {profiles, tags, auth} from '../../redux/outstaffingSlice'
import {getRole} from '../../redux/roleSlice'
import {profiles, tags} from '../../redux/outstaffingSlice'
import {useRequest} from "../../hooks/useRequest";
const Home = () => {
const [isLoadingMore, setIsLoadingMore] = useState(false);
@ -48,7 +45,8 @@ const Home = () => {
);
dispatch(tags(tempTags))
})
}, [dispatch, index]);
console.log(1)
}, [index]);
const loadMore = (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 OutstaffingBlock from '../OutstaffingBlock/OutstaffingBlock'
import TagSelect from '../Select/TagSelect'
import {
selectTags,
getPositionId,
setPositionId
} from '../../redux/outstaffingSlice'
import { selectTags, getPositionId, setPositionId} from '../../redux/outstaffingSlice'
import front from '../../images/front_end.png'
import back from '../../images/back_end.png'
import design from '../../images/design.png'

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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