From 236062c6c6278c4b433463fef9fa37eebf3fd760 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 9 Aug 2020 16:09:21 +0300 Subject: feat: lazy-load pages --- src/components/Loading/Loading.tsx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/components/Loading/Loading.tsx (limited to 'src/components/Loading/Loading.tsx') diff --git a/src/components/Loading/Loading.tsx b/src/components/Loading/Loading.tsx new file mode 100644 index 0000000..30b8cda --- /dev/null +++ b/src/components/Loading/Loading.tsx @@ -0,0 +1,24 @@ +import React from 'react'; +import CircularProgress from '@material-ui/core/CircularProgress'; +import { makeStyles } from '@material-ui/core'; + +const useStyles = makeStyles(theme => ({ + loader: { + width: '100%', + textAlign: 'center', + marginTop: theme.spacing(10) + } +})); + +const Loading: React.FC = () => { + const classes = useStyles(); + + return ( +
+ +
+ ); +}; + +export default Loading; + -- cgit v1.2.3 From 08e9e3abb9830b6c46f46aacb6a40ba32c4c665f Mon Sep 17 00:00:00 2001 From: eug-vs Date: Mon, 10 Aug 2020 00:49:49 +0300 Subject: feat: memoize static components --- src/components/Loading/Loading.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/components/Loading/Loading.tsx') diff --git a/src/components/Loading/Loading.tsx b/src/components/Loading/Loading.tsx index 30b8cda..34d436b 100644 --- a/src/components/Loading/Loading.tsx +++ b/src/components/Loading/Loading.tsx @@ -10,7 +10,7 @@ const useStyles = makeStyles(theme => ({ } })); -const Loading: React.FC = () => { +const Loading: React.FC = React.memo(() => { const classes = useStyles(); return ( @@ -18,7 +18,7 @@ const Loading: React.FC = () => { ); -}; +}); export default Loading; -- cgit v1.2.3