Updated Modal to Material UI

This commit is contained in:
Ruidy Nemausat 2020-04-17 14:40:45 +02:00
parent d5ff0b4c44
commit 7da47f6eb9

View file

@ -1,16 +1,15 @@
import React, { FC, CSSProperties } from "react";
import React, { FC } from "react";
import Dialog from "@material-ui/core/Dialog";
interface IProps {
handleClose: () => void;
show: boolean;
}
export const Modal: FC<IProps> = ({ handleClose, show, children }) => {
const showHideStyle: CSSProperties = show
? { display: "block", zIndex: 10 }
: { display: "none", zIndex: 10 };
return (
<div className="modal" style={showHideStyle}>
<div className="modal-content">{children}</div>
</div>
<Dialog open={show} onClose={handleClose}>
{children}
</Dialog>
);
};