diff --git a/components/CopyField.jsx b/components/CopyField.jsx index bc37856..529b6bf 100644 --- a/components/CopyField.jsx +++ b/components/CopyField.jsx @@ -44,7 +44,7 @@ const CopyField = (props) => { className="btn btn-success" type="button" > - + {t("Go")} */} @@ -53,7 +53,7 @@ const CopyField = (props) => { onClick={handleClickOnButton} type="button" > - + {t("Copy")} diff --git a/components/Error.jsx b/components/Error.jsx index dc855db..58ba291 100644 --- a/components/Error.jsx +++ b/components/Error.jsx @@ -1,16 +1,14 @@ import Link from "next/link"; -import { Container, Row, Col } from "reactstrap"; -import { useTranslation } from "next-i18next"; +import {Container, Row, Col} from "reactstrap"; +import {useTranslation} from "next-i18next"; const Error = (props) => { - const { t } = useTranslation(); + const {t} = useTranslation(); return ( - - - logo - + + logo @@ -19,12 +17,10 @@ const Error = (props) => { - - - {t("common.backHomepage")} - + + {t("common.backHomepage")} - + { }; return ( ); diff --git a/components/banner/Gform.jsx b/components/banner/Gform.jsx index cd20281..0c5866d 100644 --- a/components/banner/Gform.jsx +++ b/components/banner/Gform.jsx @@ -12,7 +12,7 @@ const Gform = (props) => { target="_blank" rel="noopener noreferrer" > - + Votre avis nous intéresse ! ); diff --git a/components/banner/Paypal.jsx b/components/banner/Paypal.jsx index fdec7dc..421b91a 100644 --- a/components/banner/Paypal.jsx +++ b/components/banner/Paypal.jsx @@ -30,7 +30,7 @@ const Paypal = () => { title={t("PayPal - The safer, easier way to pay online!")} > {" "} - + {t("Support us !")} diff --git a/components/form/CandidateField.jsx b/components/form/CandidateField.jsx index 141b5ae..02e71e8 100644 --- a/components/form/CandidateField.jsx +++ b/components/form/CandidateField.jsx @@ -1,24 +1,15 @@ -import { useState } from "react"; import ButtonWithConfirm from "./ButtonWithConfirm"; -import { Row, Col, Input, InputGroup, InputGroupAddon } from "reactstrap"; -import { useTranslation } from "react-i18next"; +import {Row, Col, Input, InputGroup, InputGroupAddon} from "reactstrap"; +import {useTranslation} from "react-i18next"; import HelpButton from "@components/form/HelpButton"; -const DragHandle = ({ children }) => ( - {children} -); -const CandidateField = ({ label, candIndex, onDelete, ...inputProps }) => { - const { t } = useTranslation(); +const CandidateField = ({label, candIndex, onDelete, ...inputProps}) => { + const {t} = useTranslation(); return ( - - - {candIndex + 1} - - { > - + {t( "Enter the name of your candidate or proposal here (250 characters max.)" diff --git a/components/form/CandidatesField.jsx b/components/form/CandidatesField.jsx index e7fd972..2792943 100644 --- a/components/form/CandidatesField.jsx +++ b/components/form/CandidatesField.jsx @@ -1,27 +1,24 @@ -import { useState, useEffect, createRef } from "react"; -import { useTranslation } from "react-i18next"; -import { Button, Card, CardBody } from "reactstrap"; -import { faPlus } from "@fortawesome/free-solid-svg-icons"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import {useState, useEffect, createRef} from "react"; +import {useTranslation} from "react-i18next"; +import {Button, Card, CardBody} from "reactstrap"; +import {faPlus} from "@fortawesome/free-solid-svg-icons"; +import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; import CandidateField from "./CandidateField"; -const SortableItem = ({ className, ...childProps }) => ( +const SortableItem = ({className, ...childProps}) => (
  • ); -const SortableContainer = ({ children }) => { - return
      {children}
    ; -}; -const CandidatesField = ({ onChange }) => { - const { t } = useTranslation(); +const CandidatesField = ({onChange}) => { + const {t} = useTranslation(); const [candidates, setCandidates] = useState([]); const addCandidate = () => { if (candidates.length < 1000) { - candidates.push({ label: "", fieldRef: createRef() }); + candidates.push({label: "", fieldRef: createRef()}); setCandidates([...candidates]); onChange(candidates); } else { @@ -37,8 +34,8 @@ const CandidatesField = ({ onChange }) => { const removeCandidate = (index) => { if (candidates.length === 1) { const newCandidates = []; - newCandidates.push({ label: "", fieldRef: createRef() }); - newCandidates.push({ label: "", fieldRef: createRef() }); + newCandidates.push({label: "", fieldRef: createRef()}); + newCandidates.push({label: "", fieldRef: createRef()}); setCandidates(newCandidates); onChange(newCandidates); } else { @@ -65,20 +62,15 @@ const CandidatesField = ({ onChange }) => { } }; - const onSortEnd = ({ oldIndex, newIndex }) => { - setCandidates(candidates, oldIndex, newIndex); - }; - return ( <> - +
      {candidates.map((candidate, index) => { const className = "sortable"; return ( removeCandidate(index)} @@ -88,7 +80,7 @@ const CandidatesField = ({ onChange }) => { /> ); })} - +
    diff --git a/components/form/ConfirmModal.jsx b/components/form/ConfirmModal.jsx index fcc23fd..a94a47a 100644 --- a/components/form/ConfirmModal.jsx +++ b/components/form/ConfirmModal.jsx @@ -20,7 +20,7 @@ const ConfirmModal = ({tabIndex, title, candidates, grades, isTimeLimited, start onClick={toggle} tabIndex={tabIndex} > - + {t("Validate")}
    -
    +
    {t("Question of the election")}
    -
    {title}
    -
    +
    {title}
    +
    {t("Candidates/Proposals")}
    -
    -
      +
      +
        {candidates.map((candidate, i) => { if (candidate.label !== "") { return ( @@ -56,10 +56,10 @@ const ConfirmModal = ({tabIndex, title, candidates, grades, isTimeLimited, start
      -
      +
      {t("Dates")}
      -
      +
      {t("The election will take place from")}{" "} {start.toLocaleDateString()}, {t("at")}{" "} @@ -72,15 +72,15 @@ const ConfirmModal = ({tabIndex, title, candidates, grades, isTimeLimited, start
      -
      +
      {t("Grades")}
      -
      +
      {grades.map((mention, i) => { return i < grades.length ? ( -
      +
      {t("Voters' list")}
      -
      +
      {emails.length > 0 ? ( emails.join(", ") ) : ( @@ -117,7 +117,7 @@ const ConfirmModal = ({tabIndex, title, candidates, grades, isTimeLimited, start
      {t("Results available at the close of the vote")}
      diff --git a/components/layouts/Header.jsx b/components/layouts/Header.jsx index f738561..c6bb603 100644 --- a/components/layouts/Header.jsx +++ b/components/layouts/Header.jsx @@ -20,31 +20,27 @@ const Header = () => { {t("title")}
      - - -
      -
      - logo -
      -
      -
      -

      - {t("Voting platform")} - {t("Majority Judgment")} -

      -
      + +
      -