From 9af3ee7da28c3acbd434602592c517b025d93252 Mon Sep 17 00:00:00 2001 From: ilyayudovin Date: Sun, 7 Jun 2020 19:46:21 +0300 Subject: fix: change Poll props --- src/PollCard/PollCard.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/PollCard/PollCard.tsx b/src/PollCard/PollCard.tsx index 27a37a2..e2ca518 100644 --- a/src/PollCard/PollCard.tsx +++ b/src/PollCard/PollCard.tsx @@ -55,10 +55,10 @@ const PercentageBar: React.FC = ({ value, which }) => { }; -const PollCard: React.FC = ({ author, contents: { left, right } }) => { +const PollCard: React.FC = (Poll) => { const classes = useStyles(); - const leftPercentage = Math.round(100 * (left.votes / (left.votes + right.votes))); + const leftPercentage = Math.round(100 * (Poll.contents.left.votes / (Poll.contents.left.votes + Poll.contents.right.votes))); const rightPercentage = 100 - leftPercentage; return ( @@ -66,23 +66,23 @@ const PollCard: React.FC = ({ author, contents: { left, right } }) => { - {author.name[0].toUpperCase()} + {Poll.author.name[0].toUpperCase()} )} - title={author.name} + title={Poll.author.name} />
-- cgit v1.2.3