* A Wrapper around the Dialog component to create centered * Login, Register or other Dialogs.
(props)
| 29 | * Login, Register or other Dialogs. |
| 30 | */ |
| 31 | function FormDialog(props) { |
| 32 | const { |
| 33 | classes, |
| 34 | open, |
| 35 | onClose, |
| 36 | loading, |
| 37 | headline, |
| 38 | onFormSubmit, |
| 39 | content, |
| 40 | actions, |
| 41 | hideBackdrop |
| 42 | } = props; |
| 43 | return ( |
| 44 | <Dialog |
| 45 | open={open} |
| 46 | onClose={onClose} |
| 47 | disableEscapeKeyDown={loading} |
| 48 | classes={{ |
| 49 | paper: classes.dialogPaper, |
| 50 | paperScrollPaper: classes.dialogPaperScrollPaper |
| 51 | }} |
| 52 | hideBackdrop={hideBackdrop ? hideBackdrop : false}> |
| 53 | <DialogTitleWithCloseIcon |
| 54 | title={headline} |
| 55 | onClose={onClose} |
| 56 | disabled={loading} |
| 57 | /> |
| 58 | <DialogContent className={classes.dialogContent}> |
| 59 | <form onSubmit={onFormSubmit}> |
| 60 | <div>{content}</div> |
| 61 | <Box width="100%" className={classes.actions}> |
| 62 | {actions} |
| 63 | </Box> |
| 64 | </form> |
| 65 | </DialogContent> |
| 66 | </Dialog> |
| 67 | ); |
| 68 | } |
| 69 | |
| 70 | FormDialog.propTypes = { |
| 71 | classes: PropTypes.object.isRequired, |
nothing calls this directly
no outgoing calls
no test coverage detected