diff options
author | eug-vs <eug-vs@keemail.me> | 2020-06-24 00:52:26 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-06-24 00:57:29 +0300 |
commit | fbdaa40e7ce585b65038835c05a283cec6f28d0e (patch) | |
tree | f7cf1593109a21841a93d237b1e28cb7735637d0 /src/components/PollCard | |
parent | 8930046d41841cba6cf368076b86e26088807848 (diff) | |
download | which-ui-fbdaa40e7ce585b65038835c05a283cec6f28d0e.tar.gz |
chore: migrate to which-types@1.3.1
Diffstat (limited to 'src/components/PollCard')
-rw-r--r-- | src/components/PollCard/PollCard.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/components/PollCard/PollCard.tsx b/src/components/PollCard/PollCard.tsx index 190d001..9f89d9a 100644 --- a/src/components/PollCard/PollCard.tsx +++ b/src/components/PollCard/PollCard.tsx @@ -7,7 +7,8 @@ import { Avatar, CardHeader } from '@material-ui/core/'; -import { Poll } from '../../types'; +import { Which, Poll } from 'which-types'; + import PercentageBar from './PercentageBar'; import {post} from '../../requests'; import teal from "@material-ui/core/colors/teal"; @@ -56,7 +57,7 @@ const PollCard: React.FC<PropTypes> = ({ poll, navigate }) => { navigate('profile', poll.author._id); }; - const vote = (which: 'left' | 'right') => { + const vote = (which: Which) => { post(`polls/${ poll._id }/votes/`,{ which }).then((response)=>{ console.log(response.data); const leftV = response.data.contents.left.votes; @@ -78,12 +79,12 @@ const PollCard: React.FC<PropTypes> = ({ poll, navigate }) => { <Avatar aria-label="avatar" src={author.avatarUrl} - alt={author.name[0].toUpperCase()} + alt={author.username[0].toUpperCase()} onClick={handleNavigate} className={classes.avatar} /> )} - title={author.name} + title={author.username} /> <div className={classes.imagesBlock}> <CardActionArea onDoubleClick={() => vote('left')}> |