From 58379bfd5385172648dbf05f0c57c32ef92cc02f Mon Sep 17 00:00:00 2001 From: Pierre-Louis Guhur Date: Wed, 30 Nov 2022 10:33:43 +0100 Subject: [PATCH] fix: ballot --- components/CandidateModalSet.tsx | 165 ------------------------- components/WaitingBallot.tsx | 38 +++--- pages/ballot/[pid]/[[...tid]].tsx | 3 +- pages/ballot/[pid]/confirm.tsx | 192 ------------------------------ pages/result/[pid]/[[...tid]].tsx | 6 +- pages/vote/[pid]/confirm.tsx | 192 ------------------------------ 6 files changed, 27 insertions(+), 569 deletions(-) delete mode 100644 components/CandidateModalSet.tsx delete mode 100644 pages/ballot/[pid]/confirm.tsx delete mode 100644 pages/vote/[pid]/confirm.tsx diff --git a/components/CandidateModalSet.tsx b/components/CandidateModalSet.tsx deleted file mode 100644 index f67b338..0000000 --- a/components/CandidateModalSet.tsx +++ /dev/null @@ -1,165 +0,0 @@ -/** - * A modal to details a candidate - */ -import {ElectionPayload} from '@services/api'; -import { - Button, - Col, - Container, - Row, - Modal, - ModalHeader, - ModalBody, -} from 'reactstrap'; - -interface CandidateModal { - isOpen: boolean; - toggle: Function; - election: ElectionPayload; -} - -const CandidateModal = ({isOpen, toggle, election}) => -( - < Modal - isOpen={isOpen} - toggle={toggle} - keyboard={true} - className="modalVote voteDesktop" - > -
- {election.name} - -
- {election.candidates.map((candidate, candidateId) => { - return ( - - -
{candidate.name}
-
{candidate.description}
- - - {election.grades.map((grade, gradeId) => { - console.assert(gradeId < numGrades); - const gradeValue = grade.value; - const color = getGradeColor(gradeId, numGrades); - return ( - - - - ); - })} - -
- ); - })} - - - - {judgments.length !== election.candidates.length ? ( - - ) : ( - - )} - - -
-
-
-