MCPcopy Create free account
hub / github.com/dunky11/react-saas-template / FormDialog

Function FormDialog

src/shared/components/FormDialog.js:31–68  ·  view source on GitHub ↗

* A Wrapper around the Dialog component to create centered * Login, Register or other Dialogs.

(props)

Source from the content-addressed store, hash-verified

29 * Login, Register or other Dialogs.
30 */
31function 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
70FormDialog.propTypes = {
71 classes: PropTypes.object.isRequired,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected