Skip to content

Commit

Permalink
fix: add optimize-image in image-scroller (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
tranquanghuy0801 authored May 1, 2021
1 parent 1995214 commit 13bb62c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/components/ImageScroller.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import React, { useState, useRef } from 'react';
import { makeStyles } from '@material-ui/core/styles';
import {
Fab,
Grid,
CircularProgress,
Card,
CardMedia,
Button,
} from '@material-ui/core';
import { Fab, Grid, CircularProgress, Card, Button } from '@material-ui/core';
import { ChevronLeft, ChevronRight } from '@material-ui/icons';
import OptimizedImage from './OptimizedImage';

/* This component currently uses fixed size cards and scroll window,
* but it wouldn't be too difficult to make it more flexible.
Expand Down Expand Up @@ -129,7 +123,13 @@ export default function ImageScroller(props) {
img === selectedImage && classes.selectedImageCard
}`}
>
<CardMedia image={img} title={img} className={classes.image} />
<OptimizedImage
src={img}
width={182}
height={192}
className={classes.image}
fixed
/>
</Card>
))
) : (
Expand Down

0 comments on commit 13bb62c

Please sign in to comment.