Pager wrong props in Challenges and Leaderboard correction

This commit is contained in:
Mateusz Tylka 2023-07-05 22:36:25 +02:00
parent 671d0ed650
commit 38735c7982
3 changed files with 5 additions and 5 deletions

View File

@ -33,7 +33,7 @@ const Challenges = () => {
statusFilterHandle(state.statusFilter, state.challenges, dispatch); statusFilterHandle(state.statusFilter, state.challenges, dispatch);
}, [state.statusFilter, state.challenges]); }, [state.statusFilter, state.challenges]);
const setPage = React.useCallback((value) => { const setPageNr = React.useCallback((value) => {
dispatch({ type: CHALLENGES_ACTION.SET_PAGE, payload: value }); dispatch({ type: CHALLENGES_ACTION.SET_PAGE, payload: value });
}, []); }, []);
@ -73,7 +73,7 @@ const Challenges = () => {
dispatch={dispatch} dispatch={dispatch}
filtersMenuRender={filtersMenuRender} filtersMenuRender={filtersMenuRender}
searchQueryHandler={searchQueryHandler} searchQueryHandler={searchQueryHandler}
setPage={setPage} setPageNr={setPageNr}
filtersMenu={state.filtersMenu} filtersMenu={state.filtersMenu}
loading={state.loading} loading={state.loading}
pageNr={state.pageNr} pageNr={state.pageNr}
@ -85,7 +85,7 @@ const Challenges = () => {
dispatch={dispatch} dispatch={dispatch}
filtersMenuRender={filtersMenuRender} filtersMenuRender={filtersMenuRender}
searchQueryHandler={searchQueryHandler} searchQueryHandler={searchQueryHandler}
setPage={setPage} setPageNr={setPageNr}
filtersMenu={state.filtersMenu} filtersMenu={state.filtersMenu}
loading={state.loading} loading={state.loading}
pageNr={state.pageNr} pageNr={state.pageNr}

View File

@ -35,7 +35,7 @@ const ChallengesDesktop = (props) => {
{!props.loading && ( {!props.loading && (
<Pager <Pager
pageNr={props.pageNr} pageNr={props.pageNr}
setPage={props.setPage} setPageNr={props.setPageNr}
elements={props.challengesFiltered} elements={props.challengesFiltered}
pages={CALC_PAGES(props.challengesFiltered)} pages={CALC_PAGES(props.challengesFiltered)}
width="72px" width="72px"

View File

@ -189,7 +189,7 @@ const Leaderboard = (props) => {
)} )}
<Pager <Pager
pageNr={pageNr} pageNr={pageNr}
elements={elements} elements={entries}
setPageNr={setPageNr} setPageNr={setPageNr}
width="72px" width="72px"
borderRadius="64px" borderRadius="64px"