/* eslint react/prop-types: 0 */ import React, { Component } from "react"; import { Col, Container, Row } from "reactstrap"; import { Link } from "react-router-dom"; import { withTranslation } from "react-i18next"; import { faCopy, faVoteYea, faExclamationTriangle, faExternalLinkAlt } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { AppContext } from "../../AppContext"; import CopyField from "../CopyField"; import Facebook from "../banner/Facebook"; class CreateSuccess extends Component { static contextType = AppContext; constructor(props) { super(props); const electionSlug = this.props.match.params.slug; this.state = { urlOfVote: window.location.origin + "/vote/" + electionSlug, urlOfResult: window.location.origin + "/result/" + electionSlug }; this.urlVoteField = React.createRef(); this.urlResultField = React.createRef(); } handleClickOnCopyResult = () => { const input = this.urlResultField.current; input.focus(); input.select(); document.execCommand("copy"); }; render() { const { t } = this.props; const electionLink = this.props.invitationOnly ? ( <>
{t( "Voters received a link to vote by email. Each link can be used only once!" )}
> ) : ( <>{t("Voting address")}
{t("Results address")}