diff options
author | eug-vs <eug-vs@keemail.me> | 2020-08-07 22:53:53 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-08-08 08:28:55 +0300 |
commit | b124be4d5067570a8f5db4813d45e1bf49d95f56 (patch) | |
tree | 3c57342af821f7ce1b4ad4be733f7e4c4738ddf6 /src/pages/Page.tsx | |
parent | 5ba6455b2aa6c75c336628bda59e70b46e3b1d6b (diff) | |
download | which-ui-b124be4d5067570a8f5db4813d45e1bf49d95f56.tar.gz |
feat: support routing in Header
Diffstat (limited to 'src/pages/Page.tsx')
-rw-r--r-- | src/pages/Page.tsx | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/src/pages/Page.tsx b/src/pages/Page.tsx index 47f5f50..f5c975c 100644 --- a/src/pages/Page.tsx +++ b/src/pages/Page.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { makeStyles, useTheme } from '@material-ui/core/styles'; import { useMediaQuery } from '@material-ui/core'; import { SnackbarProvider } from 'notistack'; -import { BrowserRouter, Switch } from 'react-router-dom'; +import { Switch } from 'react-router-dom'; import ProfilePage from './ProfilePage/ProfilePage'; import FeedPage from './FeedPage/FeedPage'; @@ -32,26 +32,24 @@ const Page: React.FC = () => { const isMobile = useMediaQuery(theme.breakpoints.down('sm')); return ( - <BrowserRouter> - <SnackbarProvider - maxSnack={3} - anchorOrigin={{ - vertical: isMobile ? 'top' : 'bottom', - horizontal: 'right' - }} - > - <div className={classes.root}> - <Switch> - <Route exact path={urls.home} component={HomePage} /> - <Route exact path={urls.login} component={LoginPage} /> - <Route exact path={urls.registration} component={RegistrationPage} /> - <Route exact path={urls.feed} component={FeedPage} /> - <Route exact path={urls.notifications} component={NotificationsPage} /> - <Route path={urls.profile} component={ProfilePage} /> - </Switch> - </div> - </SnackbarProvider> - </BrowserRouter> + <SnackbarProvider + maxSnack={3} + anchorOrigin={{ + vertical: isMobile ? 'top' : 'bottom', + horizontal: 'right' + }} + > + <div className={classes.root}> + <Switch> + <Route exact path={urls.home} component={HomePage} /> + <Route exact path={urls.login} component={LoginPage} /> + <Route exact path={urls.registration} component={RegistrationPage} /> + <Route exact path={urls.feed} component={FeedPage} /> + <Route exact path={urls.notifications} component={NotificationsPage} /> + <Route path={urls.profile()} component={ProfilePage} /> + </Switch> + </div> + </SnackbarProvider> ); }; |