11import React from 'react' ;
22import PropTypes from 'prop-types' ;
33import { Typography , Grid } from '@material-ui/core' ;
4+ import { makeStyles } from '@material-ui/core/styles' ;
45
56import { useFormApi } from '@data-driven-forms/react-form-renderer' ;
67
7- const SubForm = ( { fields, title, description, FormSpyProvider : _FormSpyProvider , validate : _validate , ...rest } ) => {
8+ const useStyles = makeStyles ( ( ) => ( {
9+ grid : {
10+ paddingRight : 0 ,
11+ paddingLeft : 0
12+ }
13+ } ) ) ;
14+
15+ const SubForm = ( { fields, title, description, ...rest } ) => {
816 const { renderForm } = useFormApi ( ) ;
17+ const classes = useStyles ( ) ;
18+
919 return (
10- < Grid item xs = { 12 } container style = { { paddingRight : 0 , paddingLeft : 0 } } { ...rest } >
20+ < Grid item xs = { 12 } container className = { classes . grid } { ...rest } >
1121 { title && (
1222 < Grid item xs = { 12 } >
1323 < Typography variant = "h5" > { title } </ Typography >
@@ -28,9 +38,7 @@ const SubForm = ({ fields, title, description, FormSpyProvider: _FormSpyProvider
2838SubForm . propTypes = {
2939 fields : PropTypes . oneOfType ( [ PropTypes . object , PropTypes . array ] ) . isRequired ,
3040 title : PropTypes . string ,
31- description : PropTypes . string ,
32- FormSpyProvider : PropTypes . any ,
33- validate : PropTypes . any
41+ description : PropTypes . string
3442} ;
3543
3644export default SubForm ;
0 commit comments