diff options
author | Jari Vetoniemi <jari.vetoniemi@indooratlas.com> | 2020-11-12 19:33:57 +0900 |
---|---|---|
committer | Jari Vetoniemi <jari.vetoniemi@indooratlas.com> | 2020-11-12 19:33:57 +0900 |
commit | 0eca7a9986cb5730cc64c858803a1a8040a7bc72 (patch) | |
tree | 03dc0018e1e9d899efef9a98a8ba7da2d3f4e68c /src/App.js | |
parent | 5c8387ac7e7b268a7257ad6671b5dc9eb34cc90b (diff) |
lazy-load card images
Diffstat (limited to 'src/App.js')
-rw-r--r-- | src/App.js | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -172,14 +172,18 @@ function StoreItem(props) { subheader={props.data.author} subheaderTypographyProps={{className: classes.text}} /> - <CardMedia className={classes.media} - image={props.data.img} - title={props.data.title} - > + <div className={classes.media}> + <CardMedia + component='img' + loading='lazy' + image={props.data.img} + title={props.data.title} + style={{height: '100%', backgroundImage:'url(/loading.png)'}} + /> <Chip label={props.data.price} className={classes.price}/> <Chip label={t(props.data.cat)} className={classes.cat}/> - <Rating name="size-small" size="small" className={classes.rating} readOnly defaultValue={props.data.rating} precision={0.5}/> - </CardMedia> + <Rating size="small" className={classes.rating} readOnly defaultValue={props.data.rating} precision={0.5}/> + </div> </CardActionArea> </Card> </Grow> |