Skip to content

Commit f8bbd41

Browse files
committed
fix(mui): add proptypes to formtemplate
1 parent 32a76ea commit f8bbd41

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

packages/mui-component-mapper/src/files/form-template.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* eslint-disable react/prop-types */
21
import React from 'react';
2+
import PropTypes from 'prop-types';
33
import { Grid, Button as MUIButton, Typography } from '@material-ui/core';
44
import { makeStyles } from '@material-ui/core/styles';
55

@@ -13,31 +13,57 @@ const useStyles = makeStyles(() => ({
1313
}));
1414

1515
const Form = ({ children, ...props }) => <form {...props}>{children}</form>;
16+
17+
Form.propTypes = {
18+
children: PropTypes.node
19+
};
20+
1621
const Description = ({ children }) => (
1722
<Grid item xs={12}>
1823
<Typography variant="body1" gutterBottom>
1924
{children}
2025
</Typography>
2126
</Grid>
2227
);
28+
29+
Description.propTypes = {
30+
children: PropTypes.node
31+
};
32+
2333
const Title = ({ children }) => (
2434
<Grid item xs={12}>
2535
<Typography variant="h3" gutterBottom>
2636
{children}
2737
</Typography>
2838
</Grid>
2939
);
40+
41+
Title.propTypes = {
42+
children: PropTypes.node
43+
};
44+
3045
const ButtonGroup = ({ children }) => {
3146
const classes = useStyles();
3247
return <div className={classes.buttonGroup}>{children}</div>;
3348
};
3449

50+
ButtonGroup.propTypes = {
51+
children: PropTypes.node
52+
};
53+
3554
const Button = ({ label, variant, children, buttonType, ...props }) => (
3655
<MUIButton color={variant} variant="contained" {...props}>
3756
{label || children}
3857
</MUIButton>
3958
);
4059

60+
Button.propTypes = {
61+
children: PropTypes.node,
62+
label: PropTypes.node,
63+
variant: PropTypes.string,
64+
buttonType: PropTypes.string
65+
};
66+
4167
const MuiFormTemplate = (props) => (
4268
<FormTemplate FormWrapper={Form} Button={Button} ButtonGroup={ButtonGroup} Title={Title} Description={Description} {...props} />
4369
);

0 commit comments

Comments
 (0)