From a39baaf6906ee6bb7709efd7068fc841f465edfa Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Fri, 6 Nov 2020 00:16:02 +0900 Subject: Lazyload store items --- src/App.js | 53 +++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) (limited to 'src/App.js') diff --git a/src/App.js b/src/App.js index 591b890..170bf18 100644 --- a/src/App.js +++ b/src/App.js @@ -43,6 +43,7 @@ import HelpOutlineIcon from '@material-ui/icons/HelpOutline'; import NavigateNextIcon from '@material-ui/icons/NavigateNext'; import NavigateBeforeIcon from '@material-ui/icons/NavigateBefore'; import Grow from '@material-ui/core/Grow'; +import LazyLoad from 'react-lazyload'; import { CarouselProvider, Slider, Slide, ButtonBack, ButtonNext } from 'pure-react-carousel'; import { useWindowDimensions } from './utils.js'; import 'pure-react-carousel/dist/react-carousel.es.css'; @@ -75,6 +76,30 @@ function StoreItemDetails(props) { ); } +function StoreItemSkeleton(props) { + return ( + +
+ + + + + + + + + . + + + + +
+ +
+ + ); +} + function StoreItem(props) { const { t } = useTranslation(); @@ -97,7 +122,7 @@ function StoreItem(props) { }))(); return ( - <> + }> @@ -123,31 +148,7 @@ function StoreItem(props) { - - ); -} - -function StoreItemSkeleton(props) { - return ( - -
- - - - - - - - - . - - - - -
- -
- + ); } -- cgit v1.2.3