aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-06-24 00:52:26 +0300
committereug-vs <eug-vs@keemail.me>2020-06-24 00:57:29 +0300
commitfbdaa40e7ce585b65038835c05a283cec6f28d0e (patch)
treef7cf1593109a21841a93d237b1e28cb7735637d0 /src/components
parent8930046d41841cba6cf368076b86e26088807848 (diff)
downloadwhich-ui-fbdaa40e7ce585b65038835c05a283cec6f28d0e.tar.gz
chore: migrate to which-types@1.3.1
Diffstat (limited to 'src/components')
-rw-r--r--src/components/Feed/Feed.tsx2
-rw-r--r--src/components/PollCard/PollCard.tsx9
2 files changed, 6 insertions, 5 deletions
diff --git a/src/components/Feed/Feed.tsx b/src/components/Feed/Feed.tsx
index 3b8e16f..c649935 100644
--- a/src/components/Feed/Feed.tsx
+++ b/src/components/Feed/Feed.tsx
@@ -1,6 +1,6 @@
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
-import { Poll } from '../../types';
+import { Poll } from 'which-types';
import PollCard from '../PollCard/PollCard';
interface PropTypes {
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')}>