Почему кнопка xxx
закрывает диалог? Разве нельзя держать его открытым, но нужно нажать кнопку входа в систему?
import React, { useState, useEffect } from "react";
import ExpandMore from "@material-ui/icons/ExpandMore";
import { withRouter } from "react-router-dom";
import moment from "moment";
import axios from "axios";
import "../../assets/styles/BuyTicket.css";
import payment from "../../assets/images/payment.png";
import FacebookLogin from "react-facebook-login";
import { fbAppId, responseFacebook, getTempUserUuid } from "../../Utility";
import { Dialog, DialogActions, DialogContent } from "@material-ui/core";
function BuyTicket(props) {
const jwt = localStorage.getItem("jwt");
console.log(props.match);
const eventTimeId = props.match.params.eventTimeId;
const [numOfTickets, setNumOfTickets] = useState(1);
const [searchedEventTime, setSearchedEventTime] = useState({});
const [invoice, setInvoice] = useState(false);
console.log(JSON.parse(localStorage.getItem("searchedEventTimeList")));
const searchedEventTimeList = JSON.parse(
localStorage.getItem("searchedEventTimeList")
);
useEffect(() => {
if (searchedEventTimeList) {
setSearchedEventTime(searchedEventTimeList[eventTimeId]);
} else {
axios
.post(`${window.baseUrl}search`, {
tempUserUuid: getTempUserUuid(),
eventTimeId
})
.then(data => {
if (Object.keys(data.data.data).length > 0) {
setSearchedEventTime(data.data.data[eventTimeId]);
} else {
alert("Event is not ongoing");
props.history.push("/");
}
});
}
}, []);
return (
<div
className="container"
style={{ display: searchedEventTime.startTime ? "block" : "none" }}
>
<button onClick={() => setInvoice(true)}>Fizetés bankkártyával</button>
<Dialog open={invoice} aria-labelledby="form-dialog-title">
<div>
<form className="invoiceForm">
<div className="invoiceFormContainer">
<div className="invoiceFormContainer">
<button>xxx</button>
</div>
</div>
</form>
</div>
</Dialog>
</div>
);
}
export default withRouter(BuyTicket);