fix: buttons on success pages

pull/73/head
Pierre-Louis Guhur 3 years ago
parent 51f179349c
commit c8d6f60239

@ -2,10 +2,16 @@
import React from "react";
import { Button } from "reactstrap";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import {
faCopy,
faVoteYea,
faExclamationTriangle,
faExternalLinkAlt,
} from "@fortawesome/free-solid-svg-icons";
const CopyField = props => {
const CopyField = (props) => {
const ref = React.createRef();
const handleClickOnField = event => {
const handleClickOnField = (event) => {
event.target.focus();
event.target.select();
};
@ -16,7 +22,7 @@ const CopyField = props => {
document.execCommand("copy");
};
const { t, value, iconCopy } = props;
const { t, value, iconCopy, iconOpen } = props;
return (
<div className="input-group ">
@ -30,6 +36,18 @@ const CopyField = props => {
/>
<div className="input-group-append">
{/*
<Button
href={value}
target="_blank"
rel="noreferrer"
className="btn btn-success"
type="button"
>
<FontAwesomeIcon icon={iconOpen} className="mr-2" />
{t("Go")}
</Button>
*/}
<Button
className="btn btn-secondary"
onClick={handleClickOnButton}
@ -39,19 +57,13 @@ const CopyField = props => {
{t("Copy")}
</Button>
</div>
{/*<div className="input-group-append">
<a
className="btn btn-secondary"
href={value}
target="_blank"
rel="noopener noreferrer"
>
<FontAwesomeIcon icon={iconOpen} className="mr-2" />
{t("Open")}
</a>
</div>*/}
</div>
);
};
CopyField.defaultProps = {
iconCopy: faCopy,
iconOpen: faExternalLinkAlt,
};
export default CopyField;

2
package-lock.json generated

@ -1959,7 +1959,7 @@
"browserify-rsa": "^4.0.1",
"create-hash": "^1.2.0",
"create-hmac": "^1.1.7",
"elliptic": "^6.5.4",
"elliptic": "^6.5.3",
"inherits": "^2.0.4",
"parse-asn1": "^5.1.5",
"readable-stream": "^3.6.0",

@ -11,6 +11,7 @@ import {
faVoteYea,
faExclamationTriangle,
faExternalLinkAlt,
faPollH,
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import CopyField from "@components/CopyField";
@ -91,16 +92,16 @@ const ConfirmElection = ({
);
const participate = invitationOnly ? null : (
<Row className="mt-4 mb-4">
<Col className="text-center">
<>
<Col className="col-lg-3 text-center mr-10">
<Link href={`/vote/${pid}`}>
<a className="btn btn-secondary">
<a target="_blank" rel="noreferrer" className="btn btn-success">
<FontAwesomeIcon icon={faVoteYea} className="mr-2" />
{t("Participate now!")}
{t("resource.participateBtn")}
</a>
</Link>
</Col>
</Row>
</>
);
return (
@ -143,7 +144,17 @@ const ConfirmElection = ({
</div>
</Col>
</Row>
{participate}
<Row className="mt-4 mb-4 justify-content-md-center">
{participate}
<Col className="text-center col-lg-3">
<Link href={`/vote/${pid}`}>
<a target="_blank" rel="noreferrer" className="btn btn-secondary">
<FontAwesomeIcon icon={faPollH} className="mr-2" />
{t("resource.resultsBtn")}
</a>
</Link>
</Col>
</Row>
</Container>
);
};

@ -49,7 +49,7 @@
"Copy": "Kopieren",
"Here is the link for the results in real time:": " Hier ist der Link für die Ergebnisse in Echtzeit:",
"Keep these links carefully": "Speichern Sie diesen Link an einem sicheren Ort.",
"Participate now!": "Machen Sie jetzt mit!",
"resource.participateBtn": "Machen Sie jetzt mit!",
"t": "<0>Achtung</0> : Sie werden zu einem späteren Zeitpunkt keine Möglichkeit haben, diese Links abzurufen, auch wir haben keinen Zugriff darauf. Sie können aber beispielsweise diese Seite in Ihrem Browser als Lesezeichen speichern.",
"Simple and free: organize an election with Majority Judgment.": "Einfach und kostenlos: Organisation von Mehrheitswahlen.",
"Start": "Start",

@ -49,7 +49,8 @@
"Copy": "Copy",
"Here is the link for the results in real time:": "Here is the link for real-time results:",
"Keep these links carefully": "Keep these links carefully",
"Participate now!": "Participate now!",
"resource.participateBtn": "Participate now!",
"resource.resultsBtn": "Go to results",
"t": "<0>Warning</0>: you will have no possibility to recover these links, and we will not be able to share them with you. For safekeeping, you can bookmark them in your browser.",
"resource.start": "Start",
"resource.noAds": "No advertising or ad cookies",

@ -49,7 +49,7 @@
"Copy": "Copiar",
"Here is the link for the results in real time:": "En este enlace puedes revisar los resultados en tiempo real",
"Keep these links carefully": "Guarda cuidadosamente estos enlaces",
"Participate now!": "¡Participa ahora!",
"resource.participateBtn": "¡Participa ahora!",
"t": "<0>Advertencia</0>: No tendrás otras opciones para recuperar los enlaces, y no podremos compartirlos contigo. Por ejemplo, puedes agregarlos a favoritos de tu buscador.",
"Simple and free: organize an election with Majority Judgment.": "Simple y gratuito: organiza una elección con Juicio Mayoritario",
"Start": "Comenzar",

@ -39,7 +39,7 @@
"Copy": "Copier",
"Here is the link for the results in real time:": "Voici le lien pour afficher les résultats en temps réel :",
"Keep these links carefully": "Gardez ces liens précieusement",
"Participate now!": "Participez maintenant !",
"resource.participateBtn": "Participez maintenant !",
"t": "<0>Attention</0> : vous n'aurez pas d'autres moyens pour récupérer ces liens par la suite, et nous ne serons pas capables de les partager avec vous. Vous pouvez, par exemple, ajouter ces liens à vos favoris dans votre navigateur.",
"Simple and free: organize an election with Majority Judgment.": "Simple et grauit: organiser une élection avec le Jugement Majoritaire.",
"Start": "Démarrer",

@ -26,9 +26,9 @@
"resource.advancedOptions": "Options avancées",
"Starting date": "Date de début",
"Ending date": "Date de fin ",
"Defined period" : "Période définie",
"Unlimited" : "Illimitée",
"Voting time" : "Durée du vote",
"Defined period": "Période définie",
"Unlimited": "Illimitée",
"Voting time": "Durée du vote",
"Grades": "Mentions",
"You can select here the number of grades for your election": "You pouvez choisir ici le nombre de mentions de votre vote",
"5 = Excellent, Very good, Good, Fair, Passable": "5 = Excellent, Très bien, Bien, Assez bien, Passable",
@ -48,7 +48,8 @@
"Copy": "Copier",
"Here is the link for the results in real time:": "Voici le lien pour afficher les résultats en temps réel :",
"Keep these links carefully": "Gardez ces liens précieusement",
"Participate now!": "Participez maintenant !",
"resource.participateBtn": "Participez maintenant !",
"resource.resultsBtn": "Résultats",
"t": "<0>Attention</0> : vous n'aurez pas d'autres moyens pour récupérer ces liens par la suite, et nous ne serons pas capables de les partager avec vous. Vous pouvez, par exemple, ajouter ces liens à vos favoris dans votre navigateur.",
"resource.start": "Démarrer",
"resource.noAds": "Pas de publicités, ni de cookies publicitaires",
@ -87,19 +88,18 @@
"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 :",
"Access to results" : "Accès aux résultats",
"Access to results": "Accès aux résultats",
"Immediately": "Immédiatement",
"At the end of the election": "A la clôture du vote",
"Results available at the close of the vote": "Résultats disponibles à la clôture du vote",
"The results page will not be accessible until all participants have voted.":"La page de résultats ne sera pas accessible tant que tous les participants n'auront pas voté.",
"The results page will not be accessible until all participants have voted.": "La page de résultats ne sera pas accessible tant que tous les participants n'auront pas voté.",
"The results page will not be accessible until the end date is reached.": "La page de résultats ne sera pas accessible tant que la date de fin ne sera pas atteinte.",
"No one will be able to see the result until the end date is reached or until all participants have voted.": "Personne ne pourra voir le résultat tant que la date de fin n'est pas atteinte ou que tous les participants n'ont pas voté.",
"Send me this link" : "Envoyez-moi ce lien",
"Send me these links" : "Envoyez-moi ces liens",
"Open" : "Ouvrir",
"Voting address" : "Adresse du vote",
"Results address" : "Adresse des résultats",
"Share election on Facebook" : "Partager le vote sur Facebook",
"Share results on Facebook" : "Partager ces résultats sur Facebook"
"Send me this link": "Envoyez-moi ce lien",
"Send me these links": "Envoyez-moi ces liens",
"Open": "Ouvrir",
"Voting address": "Adresse du vote",
"Results address": "Adresse des résultats",
"Share election on Facebook": "Partager le vote sur Facebook",
"Share results on Facebook": "Partager ces résultats sur Facebook"
}

@ -49,7 +49,7 @@
"Copy": "Скопировать",
"Here is the link for the results in real time:": "Ссылка на результаты в режиме онлайн:",
"Keep these links carefully": "Сохраните эти ссылки, чтобы не потерять",
"Participate now!": "Участвуйте сейчас!",
"resource.participateBtn": "Участвуйте сейчас!",
"t": "<0>Предупреждение</0>: вы не сможете восстановить ссылки и не сможете ими поделиться. Например, вы можете добавить их в избранное в вашем браузере.",
"Simple and free: organize an election with Majority Judgment.": "Просто и бесплатно: создайте голосование с Решением Большинства.",
"Start": "Начать",

Loading…
Cancel
Save