maybe fix

This commit is contained in:
Martin Quarda 2024-05-08 15:57:56 +02:00
parent 6092211771
commit e1b9d11569

View File

@ -32,8 +32,8 @@ class Main extends Component {
})
window.addEventListener("hashchange", (e) => {this.onHashChange(e)})
}
togglePhoto = () => {
this.setState(state => ({ photoIsOpen: !state.photoIsOpen }))
closePhoto = () => {
this.setState(state => ({ photoIsOpen: false }))
}
openPhoto = (event, {index}) => {
this.setState({
@ -69,8 +69,8 @@ class Main extends Component {
this.setState({faq: !this.state.faq});
}
renderCloseButton(){
return <button style={{"top": 0, "right": 0}} onClick={(e) => {this.togglePhoto()}}>
<svg xmlns="http://www.w3.org/2000/svg" width="92" height="92" id="cross"><path fill="white" d="M70.7 64.3c1.8 1.8 1.8 4.6 0 6.4-.9.9-2 1.3-3.2 1.3-1.2 0-2.3-.4-3.2-1.3L46 52.4 27.7 70.7c-.9.9-2 1.3-3.2 1.3s-2.3-.4-3.2-1.3c-1.8-1.8-1.8-4.6 0-6.4L39.6 46 21.3 27.7c-1.8-1.8-1.8-4.6 0-6.4 1.8-1.8 4.6-1.8 6.4 0L46 39.6l18.3-18.3c1.8-1.8 4.6-1.8 6.4 0 1.8 1.8 1.8 4.6 0 6.4L52.4 46l18.3 18.3z"></path></svg>
return <button onClick={(e) => {this.closePhoto()}}>
<svg xmlns="http://www.w3.org/2000/svg" width="92" height="92" id="cross"><path d="M70.7 64.3c1.8 1.8 1.8 4.6 0 6.4-.9.9-2 1.3-3.2 1.3-1.2 0-2.3-.4-3.2-1.3L46 52.4 27.7 70.7c-.9.9-2 1.3-3.2 1.3s-2.3-.4-3.2-1.3c-1.8-1.8-1.8-4.6 0-6.4L39.6 46 21.3 27.7c-1.8-1.8-1.8-4.6 0-6.4 1.8-1.8 4.6-1.8 6.4 0L46 39.6l18.3-18.3c1.8-1.8 4.6-1.8 6.4 0 1.8 1.8 1.8 4.6 0 6.4L52.4 46l18.3 18.3z"></path></svg>
</button>
}
render(){
@ -90,7 +90,7 @@ class Main extends Component {
<div>
<ModalGateway>
{this.state.photoIsOpen &&
<Modal onClose={this.togglePhoto}>
<Modal onClose={this.closePhoto}>
<ImageGallery
items={photos_carousel}
lazyLoad={true}