@@ -12,23 +12,38 @@ const useStyles = makeStyles(() => ({
1212 }
1313} ) ) ;
1414
15- const SubForm = ( { fields, title, description, component, ...rest } ) => {
15+ const SubForm = ( {
16+ fields,
17+ title,
18+ description,
19+ component,
20+ TitleGridProps,
21+ TitleProps,
22+ DescriptionProps,
23+ DescriptionGridProps,
24+ ItemsGridProps,
25+ ...rest
26+ } ) => {
1627 const { renderForm } = useFormApi ( ) ;
1728 const classes = useStyles ( ) ;
1829
1930 return (
2031 < Grid item xs = { 12 } container className = { classes . grid } { ...rest } >
2132 { title && (
22- < Grid item xs = { 12 } >
23- < Typography variant = "h5" > { title } </ Typography >
33+ < Grid item xs = { 12 } { ...TitleGridProps } >
34+ < Typography variant = "h5" { ...TitleProps } >
35+ { title }
36+ </ Typography >
2437 </ Grid >
2538 ) }
2639 { description && (
27- < Grid item xs = { 12 } >
28- < Typography paragraph > { description } </ Typography >
40+ < Grid item xs = { 12 } { ...DescriptionGridProps } >
41+ < Typography paragraph { ...DescriptionProps } >
42+ { description }
43+ </ Typography >
2944 </ Grid >
3045 ) }
31- < Grid item xs = { 12 } container >
46+ < Grid item xs = { 12 } container { ... ItemsGridProps } >
3247 { renderForm ( fields ) }
3348 </ Grid >
3449 </ Grid >
@@ -39,7 +54,12 @@ SubForm.propTypes = {
3954 fields : PropTypes . oneOfType ( [ PropTypes . object , PropTypes . array ] ) . isRequired ,
4055 title : PropTypes . node ,
4156 description : PropTypes . node ,
42- component : PropTypes . any
57+ component : PropTypes . any ,
58+ TitleGridProps : PropTypes . object ,
59+ TitleProps : PropTypes . object ,
60+ DescriptionProps : PropTypes . object ,
61+ DescriptionGridProps : PropTypes . object ,
62+ ItemsGridProps : PropTypes . object
4363} ;
4464
4565export default SubForm ;
0 commit comments