Skip to content

Commit 05c001c

Browse files
committed
fix(mui): Added spacing to the form template.
1 parent fef6329 commit 05c001c

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

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

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,22 @@ import FormTemplate from '@data-driven-forms/common/src/form-template';
88
const useStyles = makeStyles(() => ({
99
buttonGroup: {
1010
display: 'flex',
11-
justifyContent: 'flex-end'
11+
justifyContent: 'flex-end',
12+
'&>button:not(last-child)': {
13+
marginLeft: 8
14+
}
1215
}
1316
}));
1417

15-
const Form = ({ children, ...props }) => <form {...props}>{children}</form>;
18+
const Form = ({ children, ...props }) => (
19+
<Grid item xs={12}>
20+
<form {...props}>
21+
<Grid container item spacing={2} xs={12}>
22+
{children}
23+
</Grid>
24+
</form>
25+
</Grid>
26+
);
1627

1728
Form.propTypes = {
1829
children: PropTypes.node
@@ -44,7 +55,11 @@ Title.propTypes = {
4455

4556
const ButtonGroup = ({ children }) => {
4657
const classes = useStyles();
47-
return <div className={classes.buttonGroup}>{children}</div>;
58+
return (
59+
<Grid item xs={12}>
60+
<div className={classes.buttonGroup}>{children}</div>
61+
</Grid>
62+
);
4863
};
4964

5065
ButtonGroup.propTypes = {

0 commit comments

Comments
 (0)