|
@ -1,11 +1,12 @@ |
|
|
import React, { useEffect, useState } from 'react'; |
|
|
import React, { useEffect, useState } from 'react'; |
|
|
import PropTypes from 'prop-types'; |
|
|
import PropTypes from 'prop-types'; |
|
|
import { useSelector } from 'react-redux'; |
|
|
import { useSelector } from 'react-redux'; |
|
|
import { Button, Form, Header } from 'semantic-ui-react'; |
|
|
import { Button, Form } from 'semantic-ui-react'; |
|
|
import { useTranslation } from 'react-i18next'; |
|
|
import { useTranslation } from 'react-i18next'; |
|
|
import { VOTING_CONTRACT } from 'concordia-shared/src/constants/contracts/ContractNames'; |
|
|
import { VOTING_CONTRACT } from 'concordia-shared/src/constants/contracts/ContractNames'; |
|
|
import { drizzle } from '../../../redux/store'; |
|
|
import { drizzle } from '../../../redux/store'; |
|
|
import { TRANSACTION_ERROR, TRANSACTION_SUCCESS } from '../../../constants/TransactionStatus'; |
|
|
import { TRANSACTION_ERROR, TRANSACTION_SUCCESS } from '../../../constants/TransactionStatus'; |
|
|
|
|
|
import './styles.css'; |
|
|
|
|
|
|
|
|
const { contracts: { [VOTING_CONTRACT]: { methods: { vote } } } } = drizzle; |
|
|
const { contracts: { [VOTING_CONTRACT]: { methods: { vote } } } } = drizzle; |
|
|
|
|
|
|
|
@ -52,11 +53,10 @@ const PollVote = (props) => { |
|
|
if (hasUserVoted && !enableVoteChanges) { |
|
|
if (hasUserVoted && !enableVoteChanges) { |
|
|
return ( |
|
|
return ( |
|
|
<> |
|
|
<> |
|
|
<Header as="h4"> |
|
|
<div> |
|
|
{t('topic.poll.tab.results.user.vote', { |
|
|
{t('topic.poll.tab.results.user.vote')} |
|
|
userVote: pollOptions[userVoteIndex], |
|
|
<span className="poll-voted-option">{pollOptions[userVoteIndex]}</span> |
|
|
})} |
|
|
</div> |
|
|
</Header> |
|
|
|
|
|
<div> |
|
|
<div> |
|
|
{t('topic.poll.tab.vote.no.changes')} |
|
|
{t('topic.poll.tab.vote.no.changes')} |
|
|
</div> |
|
|
</div> |
|
@ -73,6 +73,7 @@ const PollVote = (props) => { |
|
|
key={pollOption} |
|
|
key={pollOption} |
|
|
label={pollOption} |
|
|
label={pollOption} |
|
|
value={index} |
|
|
value={index} |
|
|
|
|
|
className={index === userVoteIndex ? 'poll-voted-option' : null} |
|
|
checked={index === selectedOptionIndex} |
|
|
checked={index === selectedOptionIndex} |
|
|
disabled={voting} |
|
|
disabled={voting} |
|
|
onChange={onOptionSelected} |
|
|
onChange={onOptionSelected} |
|
|