maybe fix?
This commit is contained in:
parent
97a634204f
commit
b4b975cd2e
@ -68,21 +68,24 @@ class Main extends Component {
|
||||
this.setState({faq: !this.state.faq});
|
||||
}
|
||||
render(){
|
||||
let photos = [];
|
||||
let photos_gallery = [];
|
||||
let photos_carousel = []
|
||||
for (const photo of this.state.photos){
|
||||
photos.push({
|
||||
source: photo.original,
|
||||
photos_gallery.push({
|
||||
src: photo.thumbnail,
|
||||
width: photo.original_width,
|
||||
height: photo.original_height,
|
||||
})
|
||||
photos_carousel.push({
|
||||
source: photo.original
|
||||
})
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<ModalGateway>
|
||||
{this.state.photoIsOpen &&
|
||||
<Modal onClose={this.togglePhoto}>
|
||||
<Carousel views={photos} currentIndex={this.state.currentImage} />
|
||||
<Carousel views={photos_carousel} currentIndex={this.state.currentImage} />
|
||||
</Modal>
|
||||
}
|
||||
</ModalGateway>
|
||||
@ -100,7 +103,7 @@ class Main extends Component {
|
||||
</nav>
|
||||
{this.state.page == "#gallery" &&
|
||||
<div class="container">
|
||||
<Gallery photos={photos} onClick={this.openPhoto}/>
|
||||
<Gallery photos={photos_gallery} onClick={this.openPhoto}/>
|
||||
</div>
|
||||
}
|
||||
{this.state.page == "" &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user