feat(Polls): Display creator name for polls

This commit is contained in:
Vlad Piersec
2021-11-02 13:01:58 +02:00
committed by vp8x8
parent 8983ea41fd
commit e51655a93a
7 changed files with 39 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import type { AbstractProps } from '../AbstractPollAnswer';
const PollAnswer = (props: AbstractProps) => {
const {
creatorName,
checkBoxStates,
poll,
setCheckbox,
@@ -25,6 +26,9 @@ const PollAnswer = (props: AbstractProps) => {
<div className = 'poll-question'>
<span>{ poll.question }</span>
</div>
<div className = 'poll-creator'>
{ t('polls.by', { name: creatorName }) }
</div>
</div>
<ol className = 'poll-answer-list'>
{

View File

@@ -16,6 +16,7 @@ const PollResults = (props: AbstractProps) => {
const {
answers,
changeVote,
creatorName,
haveVoted,
showDetails,
question,
@@ -29,6 +30,9 @@ const PollResults = (props: AbstractProps) => {
<div className = 'poll-question'>
<strong>{ question }</strong>
</div>
<div className = 'poll-creator'>
{ t('polls.by', { name: creatorName }) }
</div>
</div>
<ol className = 'poll-result-list'>
{answers.map(({ name, percentage, voters, voterCount }, index) =>