diff options
Diffstat (limited to 'src/components/PollCard/PollCard.tsx')
-rw-r--r-- | src/components/PollCard/PollCard.tsx | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/components/PollCard/PollCard.tsx b/src/components/PollCard/PollCard.tsx index ef7391e..12f7198 100644 --- a/src/components/PollCard/PollCard.tsx +++ b/src/components/PollCard/PollCard.tsx @@ -60,16 +60,11 @@ const PollCard: React.FC<PropTypes> = ({ initialPoll }) => { const { enqueueSnackbar } = useSnackbar(); const date: string = new Date(poll.createdAt).toLocaleString('default', DATE_FORMAT); - - const showSnackBar = (message: string) => { - enqueueSnackbar(message, { - variant: 'error' - }); - }; - const handleVote = (which: Which) => { if (vote) { - showSnackBar('You have already voted'); + enqueueSnackbar('You have already voted', { + variant: 'error' + }); return; } post('votes/', { which, pollId: poll._id }).then(response => { |