diff options
author | ilyayudovin <ilyayudovin123@gmail.com> | 2020-07-01 15:26:08 +0300 |
---|---|---|
committer | ilyayudovin <ilyayudovin123@gmail.com> | 2020-07-01 15:26:08 +0300 |
commit | f9999d6da7752a55ad01f85dce34086c1acbff5a (patch) | |
tree | 7cfd6ff4b8bd154074b9a42aaf4efe5b9cd471e6 /src/pages/Page.tsx | |
parent | 75c1dac4bceddab1d94b9e43c2fb2035297eb6bd (diff) | |
download | which-ui-f9999d6da7752a55ad01f85dce34086c1acbff5a.tar.gz |
move snack provider to Page component
Diffstat (limited to 'src/pages/Page.tsx')
-rw-r--r-- | src/pages/Page.tsx | 19 |
1 files changed, 14 insertions, 5 deletions
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> ); }; |