import React, {Component} from 'react'; import {Col, Container, Row} from 'reactstrap'; import {Link} from 'react-router-dom'; import {withTranslation, Trans} from 'react-i18next'; 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'; import CopyField from '../CopyField'; 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 = event => { 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('You can now share the election link to participants:')}

); return ( logo

{t('Successful election creation!')}

{electionLink}

{t('Here is the link for the results in real time:')}

{t('Keep these links carefully')}

Warning: you will have no other choices to recover the links, and we will not be able to share them with you. For example, you can bookmark them in your browser.

{t('Participate now!')}
); } } export default withTranslation()(CreateSuccess);