diff --git a/package.json b/package.json index 3daaa66..94ac1c7 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "@babel/core": "7.4.3", "@fortawesome/fontawesome-free": "^5.9.0", "@fortawesome/fontawesome-svg-core": "^1.2.19", + "@fortawesome/free-brands-svg-icons": "^5.13.0", "@fortawesome/free-solid-svg-icons": "^5.9.0", "@fortawesome/react-fontawesome": "^0.1.4", "@svgr/webpack": "4.1.0", @@ -62,6 +63,7 @@ "react-dev-utils": "^9.0.1", "react-dom": "^16.8.6", "react-flag-icon-css": "^1.0.25", + "react-flags-select": "^1.1.12", "react-i18next": "^11.3.4", "react-loader-spinner": "^3.1.14", "react-multi-email": "^0.5.3", diff --git a/public/locale/i18n/de/resource.json b/public/locale/i18n/de/resource.json index 76b4777..9b24372 100644 --- a/public/locale/i18n/de/resource.json +++ b/public/locale/i18n/de/resource.json @@ -1,7 +1,7 @@ { "Homepage": " Homepage ", "Source code": "Quellcode", - "Who are we": "Wer wir sind", + "Who are we?": "Wer wir sind?", "BetterVote": " BetterVote", "Voting platform": "Wahlplattform", "Majority Judgment": " Mehrheitswahl ", @@ -50,6 +50,9 @@ "You have to judge every candidate/proposal!": "Sie müssen jeden Kandidaten/Abstimmungsvorschlag bewerten!", "Your participation was recorded with success!": " Ihre Teilnahme wurde gespeichert!", "Thanks for your participation.": " Vielen Dank für Ihre Teilnahme.", + "Support us !" : "Unterstützen Sie uns!", + "PayPal - The safer, easier way to pay online!" : "PayPal - Die sicherere und einfachere Art, online zu bezahlen!", + "Number of votes:" : "Anzahl der Stimmen:" "Unknown error. Try again please.": "__STRING_NOT_TRANSLATED__", "Ending date:": "__STRING_NOT_TRANSLATED__", "If you list voters' emails, only them will be able to access the election": "__STRING_NOT_TRANSLATED__", @@ -71,5 +74,4 @@ "You need a token to vote in this election": "__STRING_NOT_TRANSLATED__", "You seem to have already voted.": "__STRING_NOT_TRANSLATED__", "The parameters of the election are incorrect.": "__STRING_NOT_TRANSLATED__", - "Number of votes:": "__STRING_NOT_TRANSLATED__" } diff --git a/public/locale/i18n/en/resource.json b/public/locale/i18n/en/resource.json index ec94e02..2bc1c4d 100644 --- a/public/locale/i18n/en/resource.json +++ b/public/locale/i18n/en/resource.json @@ -1,7 +1,7 @@ { "Homepage": "Homepage", "Source code": "Source code", - "Who are we": "Who are we", + "Who are we?": "Who are we?", "BetterVote": "BetterVote", "Voting platform": "Voting platform", "Majority Judgment": "Majority Judgment", @@ -78,5 +78,7 @@ "You need a token to vote in this election": "You need a token to vote in this election", "You seem to have already voted.": "You seem to have already voted.", "The parameters of the election are incorrect.": "The parameters of the election are incorrect.", - "Number of votes:": "Number of votes:" + "Support us !" : "Support us !", + "PayPal - The safer, easier way to pay online!" : "PayPal - The safer, easier way to pay online!", + "Number of votes:" : "Number of votes:" } diff --git a/public/locale/i18n/es/resource.json b/public/locale/i18n/es/resource.json index 5ab4346..5b06cfd 100644 --- a/public/locale/i18n/es/resource.json +++ b/public/locale/i18n/es/resource.json @@ -1,7 +1,7 @@ { "Homepage": "Página de inicio", "Source code": "Código fuente", - "Who are we": "Quiénes somos", + "Who are we?": "¿Quiénes somos?", "BetterVote": "VotarMejor", "Voting platform": "Plataforma de votación", "Majority Judgment": "Juicio Mayoritario", @@ -78,5 +78,7 @@ "You need a token to vote in this election": "__STRING_NOT_TRANSLATED__", "You seem to have already voted.": "__STRING_NOT_TRANSLATED__", "The parameters of the election are incorrect.": "__STRING_NOT_TRANSLATED__", - "Number of votes:": "__STRING_NOT_TRANSLATED__" + "Support us !" : "¡Apóyanos!", + "PayPal - The safer, easier way to pay online!" : "PayPal - ¡La forma más segura y fácil de pagar en línea!", + "Number of votes:" : "Número de votos:" } diff --git a/public/locale/i18n/fr/resource.json b/public/locale/i18n/fr/resource.json index 7e7de65..54d5578 100644 --- a/public/locale/i18n/fr/resource.json +++ b/public/locale/i18n/fr/resource.json @@ -1,7 +1,7 @@ { "Homepage": "Accueil", "Source code": "Code source", - "Who are we": "Qui sommes-nous", + "Who are we?": "Qui sommes-nous ?", "BetterVote": "MieuxVoter", "Voting platform": "Plateforme de vote", "Majority Judgment": "Jugement Majoritaire", @@ -78,5 +78,7 @@ "You need a token to vote in this election": "Vous avez besoin d'un jeton pour voter dans cette élection", "You seem to have already voted.": "Il semble que vous ayez déjà voté.", "The parameters of the election are incorrect.": "Les paramètres de l'élection sont incorrects.", - "Number of votes:": "Nombre de votes :" + "Support us !" : "Soutenez-nous !", + "PayPal - The safer, easier way to pay online!" : "PayPal - Le moyen le plus sûr et le plus simple de payer en ligne !", + "Number of votes:" : "Nombre de votes :" } diff --git a/src/Errors.js b/src/Errors.js index 27f8c11..a665df0 100644 --- a/src/Errors.js +++ b/src/Errors.js @@ -1,49 +1,60 @@ -import React from 'react'; -import { - Container, - Row, - Col, -} from "reactstrap"; +import React from "react"; +import { Container, Row, Col } from "reactstrap"; +import { Link } from "react-router-dom"; +import logoLine from "./logos/logo-line-white.svg"; +import { withTranslation } from "react-i18next"; -export const UNKNOWN_ELECTION_ERROR = 'E1'; -export const ONGOING_ELECTION_ERROR = 'E2'; -export const NO_VOTE_ERROR = 'E3'; -export const ELECTION_NOT_STARTED_ERROR = 'E4'; -export const ELECTION_FINISHED_ERROR = 'E5'; -export const INVITATION_ONLY_ERROR = 'E6'; -export const UNKNOWN_TOKEN_ERROR = 'E7'; -export const USED_TOKEN_ERROR = 'E8'; -export const WRONG_ELECTION_ERROR = 'E9'; +export const UNKNOWN_ELECTION_ERROR = "E1"; +export const ONGOING_ELECTION_ERROR = "E2"; +export const NO_VOTE_ERROR = "E3"; +export const ELECTION_NOT_STARTED_ERROR = "E4"; +export const ELECTION_FINISHED_ERROR = "E5"; +export const INVITATION_ONLY_ERROR = "E6"; +export const UNKNOWN_TOKEN_ERROR = "E7"; +export const USED_TOKEN_ERROR = "E8"; +export const WRONG_ELECTION_ERROR = "E9"; export const redirectError = (errorMsg, history) => {}; export const errorMessage = (error, t) => { if (error.startsWith(UNKNOWN_ELECTION_ERROR)) { - return t('Oops... The election is unknown.'); + return t("Oops... The election is unknown."); } else if (error.startsWith(ONGOING_ELECTION_ERROR)) { return t( - "The election is still going on. You can't access now to the results.", + "The election is still going on. You can't access now to the results." ); } else if (error.startsWith(NO_VOTE_ERROR)) { - return t('No votes have been recorded yet. Come back later.'); + return t("No votes have been recorded yet. Come back later."); } else if (error.startsWith(ELECTION_NOT_STARTED_ERROR)) { - return t('The election has not started yet.'); + return t("The election has not started yet."); } else if (error.startsWith(ELECTION_FINISHED_ERROR)) { - return t('The election is over. You can\'t vote anymore'); + return t("The election is over. You can't vote anymore"); } else if (error.startsWith(INVITATION_ONLY_ERROR)) { - return t('You need a token to vote in this election'); + return t("You need a token to vote in this election"); } else if (error.startsWith(USED_TOKEN_ERROR)) { - return t('You seem to have already voted.'); + return t("You seem to have already voted."); } else if (error.startsWith(WRONG_ELECTION_ERROR)) { - return t('The parameters of the election are incorrect.'); + return t("The parameters of the election are incorrect."); } }; -export const Error = (props) => ( +export const Error = props => ( - -

{props.value}

+ + logo + +
+ + +

{props.value}

+ +
+ + + + Back to home page +
diff --git a/src/components/banner/Helloasso.jsx b/src/components/banner/Helloasso.jsx index fb0002a..7dfa6ee 100644 --- a/src/components/banner/Helloasso.jsx +++ b/src/components/banner/Helloasso.jsx @@ -9,7 +9,7 @@ const Helloasso = (props) => { return ( - + support us on helloasso ); }; diff --git a/src/components/banner/Paypal.jsx b/src/components/banner/Paypal.jsx new file mode 100644 index 0000000..38b9945 --- /dev/null +++ b/src/components/banner/Paypal.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import i18n from '../../i18n' +import {withTranslation} from 'react-i18next'; + +import { faPaypal } from "@fortawesome/free-brands-svg-icons"; +import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; + + +const Paypal = (props) => { + const {t} = props; + let localeStringShort=i18n.language.substring(0,2); + let localeStringComplete=localeStringShort.toLowerCase()+"_"+localeStringShort.toUpperCase(); + if(localeStringComplete==="en_EN"){ + localeStringComplete="en_US"; + } + const pixelLink="https://www.paypal.com/"+localeStringComplete+"/i/scr/pixel.gif"; + + return ( +
+
+ + + + +
); +}; + + +export default withTranslation()(Paypal); \ No newline at end of file diff --git a/src/components/layouts/Footer.jsx b/src/components/layouts/Footer.jsx index c762599..d28f34a 100644 --- a/src/components/layouts/Footer.jsx +++ b/src/components/layouts/Footer.jsx @@ -1,10 +1,7 @@ import React, { Component, Fragment } from "react"; import {withTranslation} from 'react-i18next'; import { Link } from "react-router-dom"; - -import { FlagIcon } from '../flag' -import i18n from '../../i18n' -import Helloasso from "../banner/Helloasso"; +import Paypal from "../banner/Paypal"; class Footer extends Component { constructor(props) { @@ -17,23 +14,15 @@ class Footer extends Component { render() { - const buttonStyle = {backgroundColor: "black", padding: "0px", border: "0px",}; const linkStyle = {whiteSpace: "nowrap"}; const {t} = this.props; - const countries = [ - {"l": "en", "flag": "gb"}, - {"l": "es", "flag": "es"}, - {"l": "fr", "flag": "fr"}, - {"l": "de", "flag": "de"}, - ]; - return ( ); diff --git a/src/components/layouts/Header.jsx b/src/components/layouts/Header.jsx index 3b4009d..5cb1e29 100644 --- a/src/components/layouts/Header.jsx +++ b/src/components/layouts/Header.jsx @@ -7,6 +7,7 @@ import { withTranslation } from 'react-i18next'; import logo from "../../logos/logo-color.svg"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faRocket } from "@fortawesome/free-solid-svg-icons"; +import LanguageSelector from "./LanguageSelector"; class Header extends Component { state = { @@ -44,10 +45,13 @@ class Header extends Component { diff --git a/src/components/layouts/LanguageSelector.jsx b/src/components/layouts/LanguageSelector.jsx new file mode 100644 index 0000000..8661e6a --- /dev/null +++ b/src/components/layouts/LanguageSelector.jsx @@ -0,0 +1,30 @@ +import React from 'react'; +import ReactFlagsSelect from 'react-flags-select'; +import 'react-flags-select/css/react-flags-select.css'; + +import i18n from '../../i18n' + + + +const LanguageSelector = () => { + + const selectHandler = (e) => { + let locale=e.toLowerCase(); + if(locale==="gb")locale="en"; + i18n.changeLanguage(locale); + }; + + let locale=i18n.language.substring(0,2).toUpperCase(); + if(locale==="EN")locale="GB"; + return (); +}; + + +export default LanguageSelector; \ No newline at end of file diff --git a/src/components/views/CreateElection.jsx b/src/components/views/CreateElection.jsx index 59db056..d6559da 100644 --- a/src/components/views/CreateElection.jsx +++ b/src/components/views/CreateElection.jsx @@ -38,6 +38,7 @@ import {AppContext} from '../../AppContext'; import HelpButton from '../form/HelpButton'; import ButtonWithConfirm from '../form/ButtonWithConfirm'; import Loader from '../wait'; +import i18n from '../../i18n' // Error messages @@ -61,90 +62,90 @@ const timeMinusDate = date => time(date); const dateMinusTime = date => new Date(date.getTime() - time(date)); const DragHandle = sortableHandle(({children}) => ( - {children} + {children} )); const displayClockOptions = () => - Array(24) - .fill(1) - .map((x, i) => ( - - )); + Array(24) + .fill(1) + .map((x, i) => ( + + )); const SortableCandidate = sortableElement(({candidate, sortIndex, form, t}) => ( -
  • - - - - - - {sortIndex + 1} - - - form.editCandidateLabel(event, sortIndex)} - onKeyPress={event => - form.handleKeypressOnCandidateLabel(event, sortIndex) - } - placeholder={t('Candidate/proposal name...')} - tabIndex={sortIndex + 1} - innerRef={ref => (form.candidateInputs[sortIndex] = ref)} - maxLength="250" - /> - -
    - -
    -
    {t('Delete?')}
    -
    - {t('Are you sure to delete')}{' '} - {candidate.label !== '' ? ( - "{candidate.label}" - ) : ( - +
  • + + + + + + {sortIndex + 1} + + + form.editCandidateLabel(event, sortIndex)} + onKeyPress={event => + form.handleKeypressOnCandidateLabel(event, sortIndex) + } + placeholder={t('Candidate/proposal name...')} + tabIndex={sortIndex + 1} + innerRef={ref => (form.candidateInputs[sortIndex] = ref)} + maxLength="250" + /> + +
    + +
    +
    {t('Delete?')}
    +
    + {t('Are you sure to delete')}{' '} + {candidate.label !== '' ? ( + "{candidate.label}" + ) : ( + {t('the row')} {sortIndex + 1} - )}{' '} - ? -
    -
    form.removeCandidate(sortIndex)}> - Oui -
    -
    Non
    -
    -
    - - - - {t( - 'Write here your question or introduce simple your election (250 characters max.)', - )} - - -
    -
  • + )}{' '} + ? + +
    form.removeCandidate(sortIndex)}> + Oui +
    +
    Non
    + + + + + + {t( + 'Write here your question or introduce simple your election (250 characters max.)', + )} + + + + )); const SortableCandidatesContainer = sortableContainer(({items, form, t}) => { return ( - + ); }); @@ -155,7 +156,7 @@ class CreateElection extends Component { // default value : start at the last hour const now = new Date(); const start = new Date( - now.getTime() - minutes(now) - seconds(now) - ms(now), + now.getTime() - minutes(now) - seconds(now) - ms(now), ); const {title} = queryString.parse(this.props.location.search); @@ -277,11 +278,12 @@ class CreateElection extends Component { } = this.state; const endpoint = resolve( - this.context.urlServer, - this.context.routesServer.setElection, + this.context.urlServer, + this.context.routesServer.setElection, ); const {t} = this.props; + const locale=i18n.language.substring(0,2).toLowerCase()==="fr"?"fr":"en"; const check = this.checkFields(); if (!check.ok) { @@ -306,6 +308,8 @@ class CreateElection extends Component { elector_emails: electorEmails, start_at: start.getTime() / 1000, finish_at: finish.getTime() / 1000, + select_language: locale, + front_url : window.location.origin }), }) .then(response => response.json()) @@ -359,235 +363,235 @@ class CreateElection extends Component { if (successCreate) return ; return ( - - - {waiting ? : ''} -
    - - -

    {t('Start an election')}

    - -
    -
    - - - - - - - - - - {t( - 'Write here your question or introduce simple your election (250 characters max.)', - )} -
    - {t('For example:')}{' '} - + + + {waiting ? : ''} + + + +

    {t('Start an election')}

    + +
    +
    + + + + + + + + + {t( - 'For the role of my representative, I judge this candidate...', + 'Write here your question or introduce simple your election (250 characters max.)', )} -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - { - this.setState({ - start: new Date( - timeMinusDate(start) + - new Date(e.target.valueAsNumber).getTime(), - ), - }); - }} - /> - - - - - -
    - - - - - - { - this.setState({ - finish: new Date( - timeMinusDate(finish) + - new Date(e.target.valueAsNumber).getTime(), - ), - }); - }} - /> - - - - - -
    - - - - - - - - - - {t( - 'You can select here the number of grades for your election', - )} -
    - {t('For example:')}{' '} - - {' '} - {t('5 = Excellent, Very good, Good, Fair, Passable')} - -
    - - - {grades.map((mention, i) => { - return ( - - {mention.label} - - ); - })} - -
    -
    - - - - - - { - this.setState({electorEmails: _emails}); - }} - validateEmail={email => { - return isEmail(email); // return boolean - }} - getLabel={(email, index, removeEmail) => { +
    + {t('For example:')}{' '} + + {t( + 'For the role of my representative, I judge this candidate...', + )} + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + { + this.setState({ + start: new Date( + timeMinusDate(start) + + new Date(e.target.valueAsNumber).getTime(), + ), + }); + }} + /> + + + + + +
    + + + + + + { + this.setState({ + finish: new Date( + timeMinusDate(finish) + + new Date(e.target.valueAsNumber).getTime(), + ), + }); + }} + /> + + + + + +
    + + + + + + + + + + {t( + 'You can select here the number of grades for your election', + )} +
    + {t('For example:')}{' '} + + {' '} + {t('5 = Excellent, Very good, Good, Fair, Passable')} + +
    + + + {grades.map((mention, i) => { return ( -
    - {email} removeEmail(index)}> + key={i} + className="badge badge-light mr-2 mt-2 " + style={{ + backgroundColor: mention.color, + color: '#fff', + opacity: i < numGrades ? 1 : 0.3, + }}> + {mention.label} + + ); + })} + + +
    + + + + + + { + this.setState({electorEmails: _emails}); + }} + validateEmail={email => { + return isEmail(email); // return boolean + }} + getLabel={(email, index, removeEmail) => { + return ( +
    + {email} + removeEmail(index)}> ×
    @@ -674,49 +678,49 @@ class CreateElection extends Component { }}> {mention.label} - ) : ( - - ); - })} -
    -
    - {t("Voters' list")} + ) : ( + + ); + })} +
    +
    + {t("Voters' list")} +
    +
    + {electorEmails.length > 0 ? ( + electorEmails.join(', ') + ) : ( +

    + {t('The form contains no address.')} +
    + + {t( + 'The election will be opened to anyone with the link', + )} + +

    + )} +
    + -
    - {electorEmails.length > 0 ? ( - electorEmails.join(', ') - ) : ( -

    - {t('The form contains no address.')} -
    - - {t( - 'The election will be opened to anyone with the link', - )} - -

    - )} +
    + {t('Start the election')}
    -
    - -
    - {t('Start the election')} -
    -
    {t('Cancel')}
    - - ) : ( - - )} - -
    - -
    +
    {t('Cancel')}
    + + ) : ( + + )} + + + + ); } } diff --git a/src/components/views/CreateSuccess.jsx b/src/components/views/CreateSuccess.jsx index ec308e7..910c623 100644 --- a/src/components/views/CreateSuccess.jsx +++ b/src/components/views/CreateSuccess.jsx @@ -2,7 +2,7 @@ import React, {Component} from 'react'; import {Button, Col, Container, Row} from 'reactstrap'; import {Link} from 'react-router-dom'; import {withTranslation, Trans} from 'react-i18next'; -import {faCopy, faUsers} from '@fortawesome/free-solid-svg-icons'; +import {faCopy, faUsers, faExclamationTriangle} from '@fortawesome/free-solid-svg-icons'; import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; import logoLine from '../../logos/logo-line-white.svg'; import {AppContext} from '../../AppContext'; @@ -18,8 +18,10 @@ class CreateSuccess extends Component { console.log(props); const electionSlug = this.props.match.params.slug; this.state = { - urlOfVote: `https://${window.location.hostname}/vote/${electionSlug}`, - urlOfResult: `https://${window.location.hostname}/result/${electionSlug}`, + urlOfVote: + window.location.origin + '/vote/' + electionSlug, + urlOfResult: + window.location.origin + '/result/' + electionSlug, }; this.urlVoteField = React.createRef(); this.urlResultField = React.createRef(); @@ -78,10 +80,12 @@ class CreateSuccess extends Component { - +

    - {t('Keep these links carefully')} + + {t('Keep these links carefully')} +

    diff --git a/src/components/views/Result.jsx b/src/components/views/Result.jsx index edb3d7d..90d07ed 100644 --- a/src/components/views/Result.jsx +++ b/src/components/views/Result.jsx @@ -66,7 +66,6 @@ class Result extends Component { profile: c.profile, grade: c.grade, })); - console.log(response); this.setState(state => ({candidates: candidates})); return response; }; diff --git a/src/components/views/VoteSuccess.jsx b/src/components/views/VoteSuccess.jsx index f9f3bd9..857539d 100644 --- a/src/components/views/VoteSuccess.jsx +++ b/src/components/views/VoteSuccess.jsx @@ -5,6 +5,7 @@ import logoLine from "../../logos/logo-line-white.svg"; import { Link } from "react-router-dom"; import { AppContext } from "../../AppContext"; import Helloasso from "../banner/Helloasso"; +import Paypal from "../banner/Paypal"; class VoteSuccess extends Component { static contextType = AppContext; @@ -22,7 +23,7 @@ class VoteSuccess extends Component {

    {t("Your participation was recorded with success!")}

    {t("Thanks for your participation.")}

    - +
    diff --git a/src/errorCode.js b/src/errorCode.js index 7299b1a..4d763fa 100644 --- a/src/errorCode.js +++ b/src/errorCode.js @@ -1,35 +1,35 @@ -import React from 'react'; +import React from "react"; -export const UNKNOWN_ELECTION_ERROR = 'E1'; -export const ONGOING_ELECTION_ERROR = 'E2'; -export const NO_VOTE_ERROR = 'E3'; -export const ELECTION_NOT_STARTED_ERROR = 'E4'; -export const ELECTION_FINISHED_ERROR = 'E5'; -export const INVITATION_ONLY_ERROR = 'E6'; -export const UNKNOWN_TOKEN_ERROR = 'E7'; -export const USED_TOKEN_ERROR = 'E8'; -export const WRONG_ELECTION_ERROR = 'E9'; +export const UNKNOWN_ELECTION_ERROR = "E1"; +export const ONGOING_ELECTION_ERROR = "E2"; +export const NO_VOTE_ERROR = "E3"; +export const ELECTION_NOT_STARTED_ERROR = "E4"; +export const ELECTION_FINISHED_ERROR = "E5"; +export const INVITATION_ONLY_ERROR = "E6"; +export const UNKNOWN_TOKEN_ERROR = "E7"; +export const USED_TOKEN_ERROR = "E8"; +export const WRONG_ELECTION_ERROR = "E9"; export const redirectError = (errorMsg, history) => {}; export const errorMessage = (error, t) => { if (error.startsWith(UNKNOWN_ELECTION_ERROR)) { - return t('Oops... The election is unknown.'); + return t("Oops... The election is unknown."); } else if (error.startsWith(ONGOING_ELECTION_ERROR)) { return t( - "The election is still going on. You can't access now to the results.", + "The election is still going on. You can't access now to the results." ); } else if (error.startsWith(NO_VOTE_ERROR)) { - return t('No votes have been recorded yet. Come back later.'); + return t("No votes have been recorded yet. Come back later."); } else if (error.startsWith(ELECTION_NOT_STARTED_ERROR)) { - return t('The election has not started yet.'); + return t("The election has not started yet."); } else if (error.startsWith(ELECTION_FINISHED_ERROR)) { - return t('The election is over. You can\'t vote anymore'); + return t("The election is over. You can't vote anymore"); } else if (error.startsWith(INVITATION_ONLY_ERROR)) { - return t('You need a token to vote in this election'); + return t("You need a token to vote in this election"); } else if (error.startsWith(USED_TOKEN_ERROR)) { - return t('You seem to have already voted.'); + return t("You seem to have already voted."); } else if (error.startsWith(WRONG_ELECTION_ERROR)) { - return t('The parameters of the election are incorrect.'); + return t("The parameters of the election are incorrect."); } }; diff --git a/src/scss/_app.scss b/src/scss/_app.scss index 03d3f89..ff7820a 100644 --- a/src/scss/_app.scss +++ b/src/scss/_app.scss @@ -47,10 +47,10 @@ main { background-attachment: fixed; background-repeat: no-repeat; background-color: $mv-blue-color; - min-height: calc(100% - 106px); + min-height: calc(100% - 170px); overflow: auto; padding-top: 72px; - padding-bottom: 36px; + padding-bottom: 100px; } header { @@ -310,3 +310,23 @@ li.sortable { .react-multi-email > span[data-placeholder] { padding: 0.25em !important; } + + +/** flag selector **/ +.flag-select > button { + height:35px; +} + +.flag-select__options{ + width:65px; + text-align:center; + background-color: $mv-light-color !important; +} + +.flag-select__options .flag-select__option{ + padding:0; + margin:0; +} +.flag-select__options .flag-select__option__icon{ + top:0; +} diff --git a/yarn.lock b/yarn.lock index 6591b92..78b7b7a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -993,6 +993,13 @@ dependencies: "@fortawesome/fontawesome-common-types" "^0.2.28" +"@fortawesome/free-brands-svg-icons@^5.13.0": + version "5.13.0" + resolved "https://registry.yarnpkg.com/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-5.13.0.tgz#e79de73ba6555055204828dca9c0691e7ce5242b" + integrity sha512-/6xXiJFCMEQxqxXbL0FPJpwq5Cv6MRrjsbJEmH/t5vOvB4dILDpnY0f7zZSlA8+TG7jwlt12miF/yZpZkykucA== + dependencies: + "@fortawesome/fontawesome-common-types" "^0.2.28" + "@fortawesome/free-solid-svg-icons@^5.9.0": version "5.13.0" resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.13.0.tgz#44d9118668ad96b4fd5c9434a43efc5903525739" @@ -8921,6 +8928,13 @@ react-flag-icon-css@^1.0.25: flag-icon-css "^3.2.1" prop-types "^15.6.2" +react-flags-select@^1.1.12: + version "1.1.12" + resolved "https://registry.yarnpkg.com/react-flags-select/-/react-flags-select-1.1.12.tgz#428b34f928eab875e8e0296046410d30d75cb818" + integrity sha512-icWC8pHdfTQTIqpLTgPcd4tFlfgUdiwzUJaSkPMzP6BEMRrh8yAJC55IkgmJV8PIX8qTUrEETZ6+6115hGjR7g== + dependencies: + prop-types "^15.5.8" + react-i18next@^11.3.4: version "11.3.4" resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-11.3.4.tgz#355df5fe5133e5e30302d166f529678100ffc968"