aboutsummaryrefslogtreecommitdiff
path: root/src/containers
diff options
context:
space:
mode:
authorEugene Sokolov <eug-vs@keemail.me>2020-08-16 23:52:59 +0300
committerGitHub <noreply@github.com>2020-08-16 23:52:59 +0300
commita2288ab4786d9886245df6c92b4fbbe5be0e7a5f (patch)
tree180722a3b885ebc0ba5411030a696bc7a0b75464 /src/containers
parent1db77b9cc96ee8f7c014f383ae71da0d225a6d6a (diff)
parente5d067dcc433e7086845946946f632565b2d5e1c (diff)
downloadwhich-ui-a2288ab4786d9886245df6c92b4fbbe5be0e7a5f.tar.gz
Merge pull request #86 from which-ecosystem/pagination
PollsList gradual load (pseudo-pagination)
Diffstat (limited to 'src/containers')
-rw-r--r--src/containers/Page/Page.tsx30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/containers/Page/Page.tsx b/src/containers/Page/Page.tsx
index a1d6456..4aa48eb 100644
--- a/src/containers/Page/Page.tsx
+++ b/src/containers/Page/Page.tsx
@@ -22,6 +22,10 @@ const useStyles = makeStyles(theme => ({
}
}));
+const ErrorFallback: React.FC = () => (
+ <EmptyState variant="error" message="Try reloading the page." />
+);
+
const Page: React.FC = () => {
const classes = useStyles();
const theme = useTheme();
@@ -35,26 +39,24 @@ const Page: React.FC = () => {
}, [history]);
return (
- <ErrorBoundary
- FallbackComponent={() => <EmptyState variant="error" message="Try reloading the page." />}
+ <SnackbarProvider
+ preventDuplicate
+ maxSnack={isMobile ? 1 : 3}
+ anchorOrigin={{
+ vertical: 'top',
+ horizontal: 'right'
+ }}
>
- <SnackbarProvider
- preventDuplicate
- maxSnack={isMobile ? 1 : 3}
- anchorOrigin={{
- vertical: 'top',
- horizontal: 'right'
- }}
- >
- <div className={classes.root}>
+ <div className={classes.root}>
+ <ErrorBoundary FallbackComponent={ErrorFallback}>
<Suspense fallback={<Loading />}>
<DynoWaiter>
<Router />
</DynoWaiter>
</Suspense>
- </div>
- </SnackbarProvider>
- </ErrorBoundary>
+ </ErrorBoundary>
+ </div>
+ </SnackbarProvider>
);
};