Skip to content

Commit c6eb728

Browse files
committed
fix(mui): useStyles in buttonGroup
1 parent f4be227 commit c6eb728

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
/* eslint-disable react/prop-types */
22
import React from 'react';
33
import { Grid, Button as MUIButton, Typography } from '@material-ui/core';
4+
import { makeStyles } from '@material-ui/core/styles';
45

56
import FormTemplate from '@data-driven-forms/common/src/form-template';
67

8+
const useStyles = makeStyles(() => ({
9+
buttonGroup: {
10+
display: 'flex',
11+
justifyContent: 'flex-end'
12+
}
13+
}));
14+
715
const Form = ({ children, ...props }) => <form {...props}>{children}</form>;
816
const Description = ({ children }) => (
917
<Grid item xs={12}>
@@ -19,7 +27,11 @@ const Title = ({ children }) => (
1927
</Typography>
2028
</Grid>
2129
);
22-
const ButtonGroup = ({ children }) => <div style={{ display: 'flex', justifyContent: 'flex-end' }}>{children}</div>;
30+
const ButtonGroup = ({ children }) => {
31+
const classes = useStyles();
32+
return <div className={classes.buttonGroup}>{children}</div>;
33+
};
34+
2335
const Button = ({ label, variant, children, buttonType, ...props }) => (
2436
<MUIButton color={variant} variant="contained" {...props}>
2537
{label || children}

0 commit comments

Comments
 (0)