aboutsummaryrefslogtreecommitdiff
path: root/src/pages/FeedPage
diff options
context:
space:
mode:
authorilyayudovin <ilyayudovin123@gmail.com>2020-07-01 14:38:39 +0300
committerilyayudovin <ilyayudovin123@gmail.com>2020-07-01 14:38:39 +0300
commit75c1dac4bceddab1d94b9e43c2fb2035297eb6bd (patch)
treed2b930d8c4464c64eb5c99077f2d5bbb4f1caf1a /src/pages/FeedPage
parent75eb28d8338c1e0601c94640303f91ef09bd583a (diff)
downloadwhich-ui-75c1dac4bceddab1d94b9e43c2fb2035297eb6bd.tar.gz
fix eslint errors
Diffstat (limited to 'src/pages/FeedPage')
-rw-r--r--src/pages/FeedPage/PollSubmission.tsx17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/pages/FeedPage/PollSubmission.tsx b/src/pages/FeedPage/PollSubmission.tsx
index f8ba26b..3088279 100644
--- a/src/pages/FeedPage/PollSubmission.tsx
+++ b/src/pages/FeedPage/PollSubmission.tsx
@@ -8,12 +8,12 @@ import {
Divider
} from '@material-ui/core';
import { Poll, Which } from 'which-types';
+import { useSnackbar } from 'notistack';
import PollSubmissionImage from './PollSubmissionImage';
import UserStrip from '../../components/UserStrip/UserStrip';
import { post } from '../../requests';
import { Contents } from './types';
import { useAuth } from '../../hooks/useAuth';
-import {useSnackbar} from "notistack";
interface PropTypes{
addPoll: (poll: Poll) => void;
@@ -35,7 +35,7 @@ const PollSubmission: React.FC<PropTypes> = ({ addPoll }) => {
const classes = useStyles();
const [expanded, setExpanded] = useState(false);
const [contents, setContents] = useState<Contents>(emptyContents);
- const { enqueueSnackbar, closeSnackbar } = useSnackbar();
+ const { enqueueSnackbar } = useSnackbar();
const { user } = useAuth();
const readyToSubmit = contents.left.url && contents.right.url;
@@ -48,6 +48,13 @@ const PollSubmission: React.FC<PropTypes> = ({ addPoll }) => {
setExpanded(false);
};
+ const showSnackBar = (message: string) => {
+ enqueueSnackbar(message, {
+ variant: 'success'
+ });
+ };
+
+
const handleClick = () => {
if (expanded && readyToSubmit) {
post('/polls/', { contents }).then(response => {
@@ -59,12 +66,6 @@ const PollSubmission: React.FC<PropTypes> = ({ addPoll }) => {
setExpanded(!expanded);
};
- const showSnackBar = (message: string) => {
- enqueueSnackbar(message, {
- variant: 'success',
- });
- };
-
return (
<ClickAwayListener onClickAway={handleClickAway}>
<Card>