maybe fix

This commit is contained in:
Martin Quarda 2024-05-08 13:32:20 +02:00
parent 98481820f9
commit a496e5ad2c

View File

@ -85,7 +85,7 @@ class Main extends Component {
})
}
if (this.state.photos.length > 3){
for(let i=this.state.currentImage - 1; i<=this.state.currentImage + 1; i++){
for(let i=this.state.currentImage-1; i<=this.state.currentImage+1; i++){
let j = i;
if(j < 0){
j += this.state.photos.length;
@ -94,12 +94,15 @@ class Main extends Component {
}
}
let carousel = <Carousel views={photos_carousel} currentIndex={0} trackProps={{onViewChange: (v) => this.onViewChange(v)}}/>
carousel.setState({currentIndex: 1})
return (
<div>
<ModalGateway>
{this.state.photoIsOpen &&
<Modal onClose={this.togglePhoto}>
<Carousel views={photos_carousel} currentIndex={1} trackProps={{onViewChange: (v) => this.onViewChange(v)}}/>
{carousel}
</Modal>
}
</ModalGateway>