From f9999d6da7752a55ad01f85dce34086c1acbff5a Mon Sep 17 00:00:00 2001
From: ilyayudovin <ilyayudovin123@gmail.com>
Date: Wed, 1 Jul 2020 15:26:08 +0300
Subject: move snack provider to Page component

---
 src/pages/FeedPage/PollSubmission.tsx | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

(limited to 'src/pages/FeedPage/PollSubmission.tsx')

diff --git a/src/pages/FeedPage/PollSubmission.tsx b/src/pages/FeedPage/PollSubmission.tsx
index 3088279..b067914 100644
--- a/src/pages/FeedPage/PollSubmission.tsx
+++ b/src/pages/FeedPage/PollSubmission.tsx
@@ -48,18 +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 => {
         addPoll(response.data);
-        showSnackBar('Your poll has been successfully created!');
+        enqueueSnackbar('Your poll has been successfully created!', {
+          variant: 'success'
+        });
       });
       setContents({ ...emptyContents });
     }
-- 
cgit v1.2.3

