Skip to content

Commit

Permalink
Update ImageGallery.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
baschenko committed Apr 20, 2024
1 parent 7d2bfba commit e648757
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/components/ImageGallery/ImageGallery.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export default class ImageGallery extends Component {
isLoading: false,
showLoadMore: false,
currentPage: 1,
showModal: false,
};
};

optimaizerImageList = images => {
return images.map(({ id, tags, largeImageURL, webformatURL }) => ({
Expand Down Expand Up @@ -80,11 +79,7 @@ export default class ImageGallery extends Component {
this.setState(prevState => ({ currentPage: prevState.currentPage + 1 }));
};

toggleModal = () => {
this.setState(({ showModal }) => ({
showModal: !showModal,
}));
};


render() {
const { capture, error, isLoading, showLoadMore, images } = this.state;
Expand All @@ -94,7 +89,7 @@ export default class ImageGallery extends Component {

{capture !== null && (
<ImageGellery>
<ImageGalleryItem hits={images} onClick={this.toggleModal} />
<ImageGalleryItem hits={images} />
</ImageGellery>
)}

Expand Down

0 comments on commit e648757

Please sign in to comment.