Skip to content

Commit 34d9d90

Browse files
committed
Add not able to vote on confirmation modal
1 parent 5af2740 commit 34d9d90

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

src/components/Process/ConfirmVoteModal.tsx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,32 @@ export const ConfirmVoteModal = ({ elections, answers }: QuestionsConfirmationPr
1717
</ModalHeader>
1818
<ModalBody display='flex' flexDirection='column' gap={5} p={0} mb={2}>
1919
<Text>{t('process.spreadsheet.confirm.description')}</Text>
20-
{Object.values(elections).map(({ election, voted, isAbleToVote }) => {
20+
{Object.values(elections).map(({ election, isAbleToVote }) => {
2121
const canAbstain =
2222
election.resultsType.name === ElectionResultsTypeNames.MULTIPLE_CHOICE &&
2323
election.resultsType.properties.canAbstain
2424
const eAnswers = answers[election.id]
25+
if (!isAbleToVote) {
26+
return (
27+
<Flex
28+
flexDirection='column'
29+
maxH='200px'
30+
overflowY='scroll'
31+
boxShadow='rgba(128, 128, 128, 0.42) 1px 1px 1px 1px'
32+
px={2}
33+
borderRadius='lg2'
34+
>
35+
<Box py={2}>
36+
<Text fontWeight='bold' whiteSpace='nowrap' mb={1}>
37+
{election.title.default}
38+
</Text>
39+
<Text fontWeight='bold' whiteSpace='nowrap' mb={1}>
40+
{t('vote.not_able_to_vote')}
41+
</Text>
42+
</Box>
43+
</Flex>
44+
)
45+
}
2546
return (
2647
<>
2748
<Flex

src/i18n/components.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export const translations = (t: TFunction<string, string>) => ({
2828
voted_description: t('cc.vote.voted_description').toString(),
2929
voted_description_multielection: t('cc.vote.voted_description_multielection').toString(),
3030
voted_title: t('cc.vote.voted_title').toString(),
31+
not_able_to_vote: t('cc.vote.not_able_to_vote').toString(),
3132
},
3233
empty: t('cc.empty').toString(),
3334
errors: {

src/i18n/locales/ca.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@
7878
"button_update": "Torna a enviar el vot",
7979
"confirm": "Confirma les teves seleccions:",
8080
"sign": "Signa abans de votar",
81+
"not_able_to_vote": "No pots votar en aquest procés",
8182
"voted_description": "Per verificar el teu vot, pots utilitzar aquesta identificació única: {{ id }}",
8283
"voted_description_multielection": "Per verificar el teu vot, pots utilitzar aquestes identificacions úniques: {{ ids }}",
83-
"voted_title": "El teu vot s'ha registrat amb èxit!"
84+
"voted_title": "El teu vot s'ha registrat amb èxit!",
8485
}
8586
},
8687
"copy": {

src/i18n/locales/es.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"button_update": "Reenviar voto",
7979
"confirm": "Confirma tus selecciones:",
8080
"sign": "Firma antes de votar",
81+
"not_able_to_vote": "No puedes votar en este proceso",
8182
"voted_description": "Para verificar tu voto, puedes utilizar este identificador único: {{ id }}",
8283
"voted_description_multielection": "Para verificar tu voto, puedes utilizar estos identificadores únicos: {{ ids }}",
8384
"voted_title": "¡Tu voto se ha registrado con éxito!"

0 commit comments

Comments
 (0)