2023-01-17 22:14:05 +03:00
|
|
|
import React from 'react'
|
|
|
|
import {useSelector, useDispatch} from 'react-redux'
|
2023-01-16 19:57:55 +03:00
|
|
|
|
2021-11-30 17:00:58 +03:00
|
|
|
import OutstaffingBlock from '../OutstaffingBlock/OutstaffingBlock'
|
|
|
|
import TagSelect from '../Select/TagSelect'
|
2023-01-16 19:57:55 +03:00
|
|
|
|
2023-01-17 22:14:05 +03:00
|
|
|
import {selectTags, getPositionId, setPositionId} from '../../redux/outstaffingSlice'
|
2023-01-16 19:57:55 +03:00
|
|
|
|
2023-01-23 14:59:48 +03:00
|
|
|
import front from './images/front_end.png'
|
|
|
|
import back from './images/back_end.png'
|
|
|
|
import design from './images/design.png'
|
2021-06-01 15:25:01 +03:00
|
|
|
|
2021-11-30 17:00:58 +03:00
|
|
|
import './outstaffing.scss'
|
2023-01-18 17:37:52 +03:00
|
|
|
|
|
|
|
|
2021-08-12 17:42:29 +03:00
|
|
|
|
2021-11-30 17:00:58 +03:00
|
|
|
const createSelectPositionHandler =
|
2023-01-17 22:14:05 +03:00
|
|
|
({positionId, setPositionId, dispatch}) =>
|
|
|
|
(id) => {
|
|
|
|
if (id === positionId) {
|
|
|
|
dispatch(setPositionId(null))
|
|
|
|
} else {
|
|
|
|
dispatch(setPositionId(id))
|
|
|
|
}
|
|
|
|
};
|
2021-08-12 17:42:29 +03:00
|
|
|
|
2021-07-01 14:25:17 +03:00
|
|
|
const Outstaffing = () => {
|
2023-01-13 13:02:48 +03:00
|
|
|
const dispatch = useDispatch();
|
|
|
|
const positionId = useSelector(getPositionId);
|
|
|
|
const tagsArr = useSelector(selectTags);
|
2021-06-01 15:25:01 +03:00
|
|
|
|
2021-11-30 17:00:58 +03:00
|
|
|
const onSelectPosition = createSelectPositionHandler({
|
|
|
|
positionId,
|
|
|
|
setPositionId,
|
|
|
|
dispatch
|
2023-01-13 13:02:48 +03:00
|
|
|
});
|
2021-06-01 15:25:01 +03:00
|
|
|
return (
|
2023-01-17 22:14:05 +03:00
|
|
|
<>
|
|
|
|
<section className='outstaffing'>
|
|
|
|
<div className='row'>
|
|
|
|
<div className='col-12 col-xl-4'>
|
|
|
|
<OutstaffingBlock
|
|
|
|
dataTags={
|
|
|
|
tagsArr &&
|
|
|
|
tagsArr.flat().filter((tag) => tag.name === 'skills_front')
|
|
|
|
}
|
|
|
|
img={front}
|
2023-04-05 19:38:38 +03:00
|
|
|
header='Frontend разработчики'
|
2023-01-17 22:14:05 +03:00
|
|
|
positionId='2'
|
|
|
|
isSelected={positionId === '2'}
|
|
|
|
onSelect={(id) => onSelectPosition(id)}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div className='col-12 col-xl-4'>
|
|
|
|
<OutstaffingBlock
|
|
|
|
dataTags={
|
|
|
|
tagsArr &&
|
|
|
|
tagsArr.flat().filter((tag) => tag.name === 'skills_back')
|
|
|
|
}
|
|
|
|
img={back}
|
2023-04-05 19:38:38 +03:00
|
|
|
header='Backend разработчики'
|
2023-01-17 22:14:05 +03:00
|
|
|
positionId='1'
|
|
|
|
isSelected={positionId === '1'}
|
|
|
|
onSelect={(id) => onSelectPosition(id)}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div className='col-12 col-xl-4'>
|
|
|
|
<OutstaffingBlock
|
|
|
|
dataTags={
|
|
|
|
tagsArr &&
|
|
|
|
tagsArr.flat().filter((tag) => tag.name === 'skills_design')
|
|
|
|
}
|
|
|
|
img={design}
|
2023-04-05 19:38:38 +03:00
|
|
|
header='Дизайн проектов'
|
2023-01-17 22:14:05 +03:00
|
|
|
positionId='5'
|
|
|
|
isSelected={positionId === '5'}
|
|
|
|
onSelect={(id) => onSelectPosition(id)}
|
|
|
|
/>
|
|
|
|
</div>
|
2021-11-30 17:00:58 +03:00
|
|
|
</div>
|
2023-01-17 22:14:05 +03:00
|
|
|
</section>
|
|
|
|
<TagSelect/>
|
|
|
|
</>
|
2021-11-30 17:00:58 +03:00
|
|
|
)
|
2023-01-13 13:02:48 +03:00
|
|
|
};
|
2021-06-01 15:25:01 +03:00
|
|
|
|
2021-11-30 17:00:58 +03:00
|
|
|
export default Outstaffing
|