aboutsummaryrefslogtreecommitdiff
path: root/src/PollCard/PollCard.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/PollCard/PollCard.tsx')
-rw-r--r--src/PollCard/PollCard.tsx12
1 files 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<PercentageBarPropTypes> = ({ value, which }) => {
};
-const PollCard: React.FC<Poll> = ({ author, contents: { left, right } }) => {
+const PollCard: React.FC<Poll> = (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<Poll> = ({ author, contents: { left, right } }) => {
<CardHeader
avatar={(
<Avatar aria-label="avatar">
- <img src={author.avatarUrl} alt={author.name[0].toUpperCase()} />
+ <img src={Poll.author.avatarUrl} alt={Poll.author.name[0].toUpperCase()} />
</Avatar>
)}
- title={author.name}
+ title={Poll.author.name}
/>
<div className={classes.imagesBlock}>
<CardActionArea>
<CardMedia
className={classes.images}
- image={left.url}
+ image={Poll.contents.left.url}
/>
<PercentageBar value={leftPercentage} which="left" />
</CardActionArea>
<CardActionArea>
<CardMedia
className={classes.images}
- image={right.url}
+ image={Poll.contents.right.url}
/>
<PercentageBar value={rightPercentage} which="right" />
</CardActionArea>