new gallery

This commit is contained in:
Martin Quarda 2024-05-08 14:10:01 +02:00
parent 4911f8fdc9
commit 4deaf036fd
3 changed files with 11 additions and 2 deletions

View File

@ -65,6 +65,7 @@
"react": "^16.8.0", "react": "^16.8.0",
"react-data-table-component": "^7.6.2", "react-data-table-component": "^7.6.2",
"react-dom": "^16.8.0", "react-dom": "^16.8.0",
"react-image-gallery": "^1.3.0",
"react-images": "1.0.0", "react-images": "1.0.0",
"react-photo-gallery": "^8.0.0", "react-photo-gallery": "^8.0.0",
"sass": "^1.70.0" "sass": "^1.70.0"

View File

@ -5,6 +5,7 @@ import { render } from "react-dom";
import Gallery from "react-photo-gallery"; import Gallery from "react-photo-gallery";
import Carousel, { Modal, ModalGateway } from "react-images"; import Carousel, { Modal, ModalGateway } from "react-images";
import ImageGallery from "react-image-gallery";
const addr_prefix = "" //"http://localhost:8000" const addr_prefix = "" //"http://localhost:8000"
@ -77,7 +78,7 @@ class Main extends Component {
height: photo.original_height, height: photo.original_height,
}) })
photos_carousel.push({ photos_carousel.push({
source: photo.original original: photo.original
}) })
}; };
return ( return (
@ -85,7 +86,13 @@ class Main extends Component {
<ModalGateway> <ModalGateway>
{this.state.photoIsOpen && {this.state.photoIsOpen &&
<Modal onClose={this.togglePhoto}> <Modal onClose={this.togglePhoto}>
<Carousel views={photos_carousel} currentIndex={this.state.currentImage} /> <ImageGallery
items={photos_carousel}
lazyLoad={true}
showPlayButton={false}
startIndex={this.state.currentImage}
showThumbnails={false}
/>
</Modal> </Modal>
} }
</ModalGateway> </ModalGateway>

View File

@ -1,4 +1,5 @@
@import "../../node_modules/bootstrap/scss/bootstrap"; @import "../../node_modules/bootstrap/scss/bootstrap";
@import "~react-image-gallery/styles/scss/image-gallery.scss";
body { body {
background: url("/public/bg.jpg") repeat-x, rgb(239, 176, 13); background: url("/public/bg.jpg") repeat-x, rgb(239, 176, 13);