Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljames-dj committed Jan 26, 2025
1 parent 55fe397 commit 0468c2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import Errored from '../../../Requests/Errored';
const RUN_VALIDATORS_QUERY_CLIENT = new QueryClient();

export default function CompetitionRangeSelector({ range, setRange }) {
const enableCompetitionCountFetch = Boolean(range?.startDate && range?.endDate);
const bothDatesAreSelected = Boolean(range?.startDate && range?.endDate);

const {
data: competitionCount, isLoading, isError,
} = useQuery({
queryKey: ['competitionCountInRange', range?.startDate, range?.endDate],
queryFn: () => getCompetitionCount(range?.startDate, range?.endDate),
enabled: enableCompetitionCountFetch,
enabled: bothDatesAreSelected,
}, RUN_VALIDATORS_QUERY_CLIENT);

return (
Expand Down Expand Up @@ -49,7 +49,7 @@ export default function CompetitionRangeSelector({ range, setRange }) {
});
}}
/>
{enableCompetitionCountFetch && (
{bothDatesAreSelected && (
<CompetitionCountViewer
isLoading={isLoading}
isError={isError}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useMemo } from 'react';
import React, { Fragment, useMemo } from 'react';
import _ from 'lodash';
import { Header, List, ListItem } from 'semantic-ui-react';
import I18n from '../../../../lib/i18n';
Expand All @@ -19,11 +19,11 @@ export default function ValidationListView({ validations, showCompetitionNameOnO
return (
<>
{Object.entries(listByGroup).map(([group, list]) => (
<>
<Fragment key={group}>
<Header as="h5">{`${headingPrefixForType(type)} ${group}`}</Header>
<List bulleted>
{list.map((validationData) => (
<ListItem>
<ListItem key={validationData.id}>
<ValidationText
validationData={validationData}
group={group}
Expand All @@ -32,7 +32,7 @@ export default function ValidationListView({ validations, showCompetitionNameOnO
</ListItem>
))}
</List>
</>
</Fragment>
))}
</>
);
Expand Down

0 comments on commit 0468c2f

Please sign in to comment.