diff --git a/packages/chakra-components/src/components/Election/Questions.tsx b/packages/chakra-components/src/components/Election/Questions.tsx index 8890eb0e..eee42fbe 100644 --- a/packages/chakra-components/src/components/Election/Questions.tsx +++ b/packages/chakra-components/src/components/Election/Questions.tsx @@ -169,10 +169,16 @@ type QuestionFieldProps = ChakraProps & { const QuestionField = ({ question, index }: QuestionFieldProps) => { const styles = useMultiStyleConfig('ElectionQuestions') - const { election, isAbleToVote, localize } = useElection() + const { + election, + isAbleToVote, + localize, + loading: { voting }, + } = useElection() const { formState: { errors }, } = useFormContext() + const disabled = election?.status !== ElectionStatus.ONGOING || !isAbleToVote || voting return ( @@ -190,11 +196,7 @@ const QuestionField = ({ question, index }: QuestionFieldProps) => { rules={{ required: localize('validation.required') }} name={index} render={({ field }) => ( - + {question.choices.map((choice, ck) => ( diff --git a/packages/chakra-components/src/components/Election/SpreadsheetAccess.tsx b/packages/chakra-components/src/components/Election/SpreadsheetAccess.tsx index 080d1bda..72c63776 100644 --- a/packages/chakra-components/src/components/Election/SpreadsheetAccess.tsx +++ b/packages/chakra-components/src/components/Election/SpreadsheetAccess.tsx @@ -25,7 +25,15 @@ export const SpreadsheetAccess = (rest: ChakraProps) => { const [loading, setLoading] = useState(false) const toast = useToast() const { env, client: cl } = useClient() - const { election, setClient, localize, fetchCensus, sikPassword, sikSignature } = useElection() + const { + election, + setClient, + localize, + fetchCensus, + sikPassword, + sikSignature, + loading: { voting }, + } = useElection() const fields: string[] = dotobject(election, 'meta.census.fields') const { register, @@ -111,7 +119,7 @@ export const SpreadsheetAccess = (rest: ChakraProps) => { if (connected) { return ( - )