1- import React , { createElement } from " react" ;
2- import PropTypes from " prop-types" ;
1+ import React , { createElement } from ' react' ;
2+ import PropTypes from ' prop-types' ;
33
44import { getInstructions } from '../../helpers/template-utils' ;
55import createPConnectComponent from '../../../bridge/react_pconnect' ;
@@ -13,19 +13,19 @@ export default function DefaultForm(props) {
1313
1414 let divClass : string ;
1515
16- const numCols = NumCols || "1" ;
16+ const numCols = NumCols || '1' ;
1717 switch ( numCols ) {
18- case "1" :
19- divClass = " psdk-default-form-one-column" ;
18+ case '1' :
19+ divClass = ' psdk-default-form-one-column' ;
2020 break ;
21- case "2" :
22- divClass = " psdk-default-form-two-column" ;
21+ case '2' :
22+ divClass = ' psdk-default-form-two-column' ;
2323 break ;
24- case "3" :
25- divClass = " psdk-default-form-three-column" ;
24+ case '3' :
25+ divClass = ' psdk-default-form-three-column' ;
2626 break ;
27- default :
28- divClass = " psdk-default-form-one-column" ;
27+ default :
28+ divClass = ' psdk-default-form-one-column' ;
2929 break ;
3030 }
3131
@@ -35,15 +35,19 @@ export default function DefaultForm(props) {
3535 // to take the children and create components for them, put in an array and pass as the
3636 // defaultForm kids
3737 const arChildren = getPConnect ( ) . getChildren ( ) [ 0 ] . getPConnect ( ) . getChildren ( ) ;
38- // eslint-disable-next-line react/no-array-index-key
39- const dfChildren = arChildren . map ( ( kid , idx ) => createElement ( createPConnectComponent ( ) , { ...kid , key : idx } ) ) ;
38+ const dfChildren = arChildren . map ( ( kid , idx ) =>
39+ // eslint-disable-next-line react/no-array-index-key
40+ createElement ( createPConnectComponent ( ) , { ...kid , key : idx } )
41+ ) ;
4042
4143 return (
42- < div className = { divClass } >
43- < div > { instructionText } </ div >
44- { dfChildren }
45- </ div >
46- )
44+ < >
45+ { instructionText && (
46+ < div className = 'psdk-default-form-instruction-text' > { instructionText } </ div >
47+ ) }
48+ < div className = { divClass } > { dfChildren } </ div >
49+ </ >
50+ ) ;
4751}
4852
4953DefaultForm . propTypes = {
@@ -52,5 +56,5 @@ DefaultForm.propTypes = {
5256} ;
5357
5458DefaultForm . defaultProps = {
55- NumCols : "1"
59+ NumCols : '1'
5660} ;
0 commit comments