Skip to content

Commit

Permalink
Fix conditional for uses_party_lists
Browse files Browse the repository at this point in the history
  • Loading branch information
VirginiaDooley committed Jun 20, 2024
1 parent 7aaae18 commit a7c8dd1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Candidates.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import { injectIntl } from 'react-intl';

function Candidates(props) {
const ballot = props.ballot;
const uses_party_lists = ballot.voting_system.uses_party_lists;
const candidatesVerified = ballot.candidates.length > 1 && ballot.candidates_verified;
const { formatMessage } = props.intl;
return (
<>
{candidatesVerified && !ballot.cancelled && (
<section className="Candidates" data-testid="candidates">
<h3>{formatMessage({ id: 'elections.candidates_heading' })}</h3>
{props.ballot.voting_system.uses_party_lists === true ? (
{uses_party_lists ? (
<PartyList {...props} />
) : (
<CandidateList candidates={props.ballot.candidates} />
Expand Down

0 comments on commit a7c8dd1

Please sign in to comment.