1
- /* eslint-disable react/prop-types */
2
1
import React from 'react' ;
2
+ import PropTypes from 'prop-types' ;
3
3
import { Grid , Button as MUIButton , Typography } from '@material-ui/core' ;
4
4
import { makeStyles } from '@material-ui/core/styles' ;
5
5
@@ -13,31 +13,57 @@ const useStyles = makeStyles(() => ({
13
13
} ) ) ;
14
14
15
15
const Form = ( { children, ...props } ) => < form { ...props } > { children } </ form > ;
16
+
17
+ Form . propTypes = {
18
+ children : PropTypes . node
19
+ } ;
20
+
16
21
const Description = ( { children } ) => (
17
22
< Grid item xs = { 12 } >
18
23
< Typography variant = "body1" gutterBottom >
19
24
{ children }
20
25
</ Typography >
21
26
</ Grid >
22
27
) ;
28
+
29
+ Description . propTypes = {
30
+ children : PropTypes . node
31
+ } ;
32
+
23
33
const Title = ( { children } ) => (
24
34
< Grid item xs = { 12 } >
25
35
< Typography variant = "h3" gutterBottom >
26
36
{ children }
27
37
</ Typography >
28
38
</ Grid >
29
39
) ;
40
+
41
+ Title . propTypes = {
42
+ children : PropTypes . node
43
+ } ;
44
+
30
45
const ButtonGroup = ( { children } ) => {
31
46
const classes = useStyles ( ) ;
32
47
return < div className = { classes . buttonGroup } > { children } </ div > ;
33
48
} ;
34
49
50
+ ButtonGroup . propTypes = {
51
+ children : PropTypes . node
52
+ } ;
53
+
35
54
const Button = ( { label, variant, children, buttonType, ...props } ) => (
36
55
< MUIButton color = { variant } variant = "contained" { ...props } >
37
56
{ label || children }
38
57
</ MUIButton >
39
58
) ;
40
59
60
+ Button . propTypes = {
61
+ children : PropTypes . node ,
62
+ label : PropTypes . node ,
63
+ variant : PropTypes . string ,
64
+ buttonType : PropTypes . string
65
+ } ;
66
+
41
67
const MuiFormTemplate = ( props ) => (
42
68
< FormTemplate FormWrapper = { Form } Button = { Button } ButtonGroup = { ButtonGroup } Title = { Title } Description = { Description } { ...props } />
43
69
) ;
0 commit comments