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 { interface IProps {
handleClose: () => void; handleClose: () => void;
show: boolean; show: boolean;
} }
export const Modal: FC<IProps> = ({ handleClose, show, children }) => { export const Modal: FC<IProps> = ({ handleClose, show, children }) => {
const showHideStyle: CSSProperties = show
? { display: "block", zIndex: 10 }
: { display: "none", zIndex: 10 };
return ( return (
<div className="modal" style={showHideStyle}> <Dialog open={show} onClose={handleClose}>
<div className="modal-content">{children}</div> {children}
</div> </Dialog>
); );
}; };