fixed code

This commit is contained in:
Hope87 2021-06-29 18:09:33 +03:00
parent 800dc0f48c
commit 397f867f2b
2 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@ const Description = ({ candidatesListArr, getCandidate, onLoadMore }) => {
<div className="col-12">
<div className={style.description__footer}>
<div className={style.description__footer__btn}>
<button onClick={() => onLoadMore(3)}>Загрузить еще</button>
<button onClick={() => onLoadMore(2)}>Загрузить еще</button>
</div>
<div className={style.description__footer__box}>
<div className={style.arrow__left}>

View File

@ -32,7 +32,7 @@ const Home = ({ getCandidate }) => {
const [tags, setTags] = useState([]);
const [profiles, setProfiles] = useState([]);
const [selectedTab, setSelectedTab] = useState('');
const [countArr, setCountArr] = useState(0);
const [countArr, setCountArr] = useState(2);
const [candidatesArray, setCandidatesArray] = useState([]);
useEffect(() => {
@ -88,7 +88,7 @@ const Home = ({ getCandidate }) => {
});
}, []);
const shorthandArray = candidatesArray.slice(countArr, 2);
const shorthandArray = candidatesArray.slice(0, countArr);
const loadMore = (count) => {
setCountArr((prev) => prev + count);