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/Page.tsx | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

(limited to 'src/pages/Page.tsx')

diff --git a/src/pages/Page.tsx b/src/pages/Page.tsx
index 6d4315e..f6353b2 100644
--- a/src/pages/Page.tsx
+++ b/src/pages/Page.tsx
@@ -1,5 +1,6 @@
 import React from 'react';
 import { makeStyles } from '@material-ui/core/styles';
+import { SnackbarProvider } from 'notistack';
 import ProfilePage from './ProfilePage/ProfilePage';
 import FeedPage from './FeedPage/FeedPage';
 import AuthPage from './AuthPage/AuthPage';
@@ -18,11 +19,19 @@ const Page: React.FC = () => {
   const classes = useStyles();
 
   return (
-    <div className={classes.root}>
-      { page.prefix === 'profile' && <ProfilePage />}
-      { page.prefix === 'feed' && <FeedPage /> }
-      { page.prefix === 'auth' && <AuthPage /> }
-    </div>
+    <SnackbarProvider
+      maxSnack={3}
+      anchorOrigin={{
+        vertical: 'bottom',
+        horizontal: 'right'
+      }}
+    >
+      <div className={classes.root}>
+        { page.prefix === 'profile' && <ProfilePage />}
+        { page.prefix === 'feed' && <FeedPage /> }
+        { page.prefix === 'auth' && <AuthPage /> }
+      </div>
+    </SnackbarProvider>
   );
 };
 
-- 
cgit v1.2.3

