Skip to content

Commit

Permalink
Add VotingVoteModal (#12)
Browse files Browse the repository at this point in the history
* Add VotingVoteModal

* Add translations
  • Loading branch information
selankon authored Oct 17, 2024
1 parent adf3567 commit 33f582f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/components/Process/View.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ProcessAside, { VoteButton } from './Aside'
import { ChainedProcesses, ChainedResults } from './Chained'
import Header from './Header'
import { SuccessVoteModal } from './SuccessVoteModal'
import VotingVoteModal from '~components/Process/VotingVoteModal'

export const ProcessView = () => {
const { t } = useTranslation()
Expand Down Expand Up @@ -146,7 +147,7 @@ export const ProcessView = () => {
>
<VoteButton />
</Box>

<VotingVoteModal />
<SuccessVoteModal />
</Box>
)
Expand Down
26 changes: 26 additions & 0 deletions src/components/Process/VotingVoteModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { useTranslation } from 'react-i18next'
import { useElection } from '@vocdoni/react-providers'
import { Modal, ModalBody, ModalContent, ModalOverlay, Spinner, Text, VStack } from '@chakra-ui/react'

const VotingVoteModal = () => {
const { t } = useTranslation()
const {
loading: { voting },
} = useElection()

return (
<Modal isOpen={voting} onClose={() => {}}>
<ModalOverlay />
<ModalContent p='30px !important'>
<ModalBody>
<VStack>
<Spinner color='process.spinner' mb={5} w={10} h={10} />
</VStack>
<Text textAlign='center'>{t('process.voting')}</Text>
</ModalBody>
</ModalContent>
</Modal>
)
}

export default VotingVoteModal
3 changes: 2 additions & 1 deletion src/i18n/locales/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@
},
"total_census_size": "{{maxCensusSize}} electors permesos de {{censusSize}} totals en el cens",
"total_census_size_tooltip": "El nombre màxim d'electors permesos està limitat a {{maxCensusSize}} d'un cens de {{censusSize}} ({{percent}}% del total). Només els primers {{maxCensusSize}} electors poden votar.",
"voters": "Votants"
"voters": "Votants",
"voting": "Estem processant el teu vot. Aquest procés trigarà uns segons. Si us plau, no tanquis ni actualitzis aquesta pàgina."
},
"process_actions": {
"cancel": "Cancel·la",
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@
},
"total_census_size": "{{maxCensusSize}} votantes permitidos de {{censusSize}} totales en el censo",
"total_census_size_tooltip": "El número máximo de votantes permitidos está limitado a {{maxCensusSize}} de un censo de {{censusSize}} ({{percent}}% del total). Solo los primeros {{maxCensusSize}} votantes pueden votar.",
"voters": "Votantes"
"voters": "Votantes",
"voting": "Estamos procesando tu voto. Este proceso tardará unos segundos. Por favor, no cierres ni actualices esta página."
},
"process_actions": {
"cancel": "Cancelar proceso",
Expand Down

1 comment on commit 33f582f

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.