1- import React , { createElement } from " react" ;
2- import PropTypes from " prop-types" ;
1+ import React , { createElement } from ' react' ;
2+ import PropTypes from ' prop-types' ;
33import { getInstructions } from '../utils' ;
44import createPConnectComponent from '../../../bridge/react_pconnect' ;
55
@@ -12,19 +12,19 @@ export default function DefaultForm(props) {
1212
1313 let divClass : string ;
1414
15- const numCols = NumCols || "1" ;
15+ const numCols = NumCols || '1' ;
1616 switch ( numCols ) {
17- case "1" :
18- divClass = " psdk-default-form-one-column" ;
17+ case '1' :
18+ divClass = ' psdk-default-form-one-column' ;
1919 break ;
20- case "2" :
21- divClass = " psdk-default-form-two-column" ;
20+ case '2' :
21+ divClass = ' psdk-default-form-two-column' ;
2222 break ;
23- case "3" :
24- divClass = " psdk-default-form-three-column" ;
23+ case '3' :
24+ divClass = ' psdk-default-form-three-column' ;
2525 break ;
26- default :
27- divClass = " psdk-default-form-one-column" ;
26+ default :
27+ divClass = ' psdk-default-form-one-column' ;
2828 break ;
2929 }
3030
@@ -34,15 +34,17 @@ export default function DefaultForm(props) {
3434 // to take the children and create components for them, put in an array and pass as the
3535 // defaultForm kids
3636 const arChildren = getPConnect ( ) . getChildren ( ) [ 0 ] . getPConnect ( ) . getChildren ( ) ;
37- // eslint-disable-next-line react/no-array-index-key
38- const dfChildren = arChildren . map ( ( kid , idx ) => createElement ( createPConnectComponent ( ) , { ...kid , key : idx } ) ) ;
37+ const dfChildren = arChildren . map ( ( kid , idx ) =>
38+ // eslint-disable-next-line react/no-array-index-key
39+ createElement ( createPConnectComponent ( ) , { ...kid , key : idx } )
40+ ) ;
3941
4042 return (
41- < div className = { divClass } >
42- < div > { instructionText } </ div >
43- { dfChildren }
44- </ div >
45- )
43+ < >
44+ { instructionText && < div className = 'psdk-default-form-instruction-text' > { instructionText } </ div > }
45+ < div className = { divClass } > { dfChildren } </ div >
46+ </ >
47+ ) ;
4648}
4749
4850DefaultForm . propTypes = {
@@ -51,5 +53,5 @@ DefaultForm.propTypes = {
5153} ;
5254
5355DefaultForm . defaultProps = {
54- NumCols : "1"
56+ NumCols : '1'
5557} ;
0 commit comments