repair myEntries

This commit is contained in:
mattyl006 2022-11-02 16:43:28 +01:00
parent a653176baf
commit b8dcd62da9
2 changed files with 17 additions and 24 deletions

View File

@ -1,27 +1,21 @@
import React from 'react'; import React from 'react';
import {FlexColumn} from '../../utils/containers'; import {FlexColumn} from '../../../utils/containers';
import {H2} from '../../utils/fonts'; import {H2} from '../../../utils/fonts';
import getMyEntries from '../../api/getMyEntries'; import getMyEntries from '../../../api/getMyEntries';
// import Search from '../elements/Search'; import Pager from '../../elements/Pager';
import Table from '../elements/Table'; import {CALC_PAGES} from '../../../utils/globals';
import Pager from '../elements/Pager';
import {CALC_PAGES} from '../../utils/globals';
import Media from 'react-media'; import Media from 'react-media';
import theme from '../../utils/theme'; import theme from '../../../utils/theme';
// import sortOptions from './Leaderboard/sortOptions'; import _tableSearchQueryHandler from '../Leaderboard/_tableSearchQueryHandler';
// import FilterBy from './FilterBy'; import Loading from '../../elements/Loading';
import _tableSearchQueryHandler from './Leaderboard/_tableSearchQueryHandler'; import _renderMySubmissions from './_renderMySubmissions';
import Loading from '../elements/Loading';
import _renderMySubmissions from './MyEntries/_renderMySubmissions';
const MyEntries = (props) => { const MyEntries = (props) => {
/* eslint-disable */
const [myEntriesFromAPI, setMyEntriesFromAPI] = React.useState({}); const [myEntriesFromAPI, setMyEntriesFromAPI] = React.useState({});
/* eslint-disable */
const [myEntries, setMyEntries] = React.useState({}); const [myEntries, setMyEntries] = React.useState({});
/* eslint-disable */
const [loading, setLoading] = React.useState(true); const [loading, setLoading] = React.useState(true);
const [pageNr, setPageNr] = React.useState(1); const [pageNr, setPageNr] = React.useState(1);
/* eslint-disable */
const [metricChoose, setMetricChoose] = React.useState(0); const [metricChoose, setMetricChoose] = React.useState(0);
const [sortBy, setSortBy] = React.useState(5); const [sortBy, setSortBy] = React.useState(5);
@ -96,13 +90,12 @@ const MyEntries = (props) => {
<H2 as='h2' margin='0 0 32px 0'> <H2 as='h2' margin='0 0 32px 0'>
My entries My entries
</H2> </H2>
{/*<Search searchQueryHandler={tableSearchQueryHandler}/>*/} <FlexColumn as='table' margin='32px 0 72px 0' width='100%'>
{/*<FilterBy header='Sort by' options={sortOptions} gridTemplateColumns='auto auto auto auto'*/} {renderSubmissions('32px', getMyEntriesHeader())}
{/* option={sortBy} textAlign='center' margin='32px 0 0 0'*/} </FlexColumn>
{/* alignmentX='center' handler={sortByHandler}/>*/} {/*<Table challengeName={props.challengeName} loading={loading}*/}
<Table challengeName={props.challengeName} loading={loading} {/* renderElements={renderSubmissions}*/}
renderElements={renderSubmissions} {/* headerElements={getMyEntriesHeader()}/>*/}
headerElements={getMyEntriesHeader()}/>
<Pager pageNr={pageNr} width='72px' borderRadius='64px' <Pager pageNr={pageNr} width='72px' borderRadius='64px'
pages={CALC_PAGES(myEntries.submissions ? myEntries.submissions : [])} pages={CALC_PAGES(myEntries.submissions ? myEntries.submissions : [])}
nextPage={nextPage} previousPage={previousPage} nextPage={nextPage} previousPage={previousPage}

View File

@ -7,7 +7,7 @@ import MobileChallengeMenu from '../components/elements/MobileChallengeMenu';
import Leaderboard from '../components/sections/Leaderboard/Leaderboard'; import Leaderboard from '../components/sections/Leaderboard/Leaderboard';
import Readme from '../components/sections/Readme'; import Readme from '../components/sections/Readme';
import HowTo from '../components/sections/HowTo'; import HowTo from '../components/sections/HowTo';
import MyEntries from '../components/sections/MyEntries'; import MyEntries from '../components/sections/MyEntries/MyEntries';
import Submit from '../components/sections/Submit'; import Submit from '../components/sections/Submit';
import Media from 'react-media'; import Media from 'react-media';
import DesktopChallengeMenu from '../components/elements/DesktopChallengeMenu'; import DesktopChallengeMenu from '../components/elements/DesktopChallengeMenu';