diff --git a/src/components/fields/DocLabel.jsx b/src/components/fields/DocLabel.jsx index 3addf05..83fd624 100644 --- a/src/components/fields/DocLabel.jsx +++ b/src/components/fields/DocLabel.jsx @@ -10,6 +10,7 @@ export default class DocLabel extends React.Component { PropTypes.string ]).isRequired, fieldSpec: PropTypes.object.isRequired, + onToggleDoc: PropTypes.func.isRequired, } constructor (props) { diff --git a/src/components/inputs/InputBlock.jsx b/src/components/inputs/InputBlock.jsx index de3de64..f35d3b1 100644 --- a/src/components/inputs/InputBlock.jsx +++ b/src/components/inputs/InputBlock.jsx @@ -17,6 +17,7 @@ class InputBlock extends React.Component { children: PropTypes.node.isRequired, style: PropTypes.object, onChange: PropTypes.func, + fieldSpec: PropTypes.object, } constructor (props) { diff --git a/src/components/inputs/SpecDoc.js b/src/components/inputs/SpecDoc.js index 390d757..6c8ddc3 100644 --- a/src/components/inputs/SpecDoc.js +++ b/src/components/inputs/SpecDoc.js @@ -1,55 +1,62 @@ import React from 'react' +import PropTypes from 'prop-types' -export default function SpecDoc (props={}) { - const {fieldSpec} = props; +export default class SpecDoc extends React.Component { + static propTypes = { + fieldSpec: PropTypes.object.isRequired, + } - const {doc} = fieldSpec; - const sdkSupport = fieldSpec['sdk-support']; + render () { + const {fieldSpec} = this.props; - const headers = { - js: "JS", - android: "Android", - ios: "iOS", - macos: "macOS", - }; + const {doc} = fieldSpec; + const sdkSupport = fieldSpec['sdk-support']; - return ( - <> - {doc && -
{doc}
- } - {sdkSupport && -
- - - - - {Object.values(headers).map(header => { - return ; + const headers = { + js: "JS", + android: "Android", + ios: "iOS", + macos: "macOS", + }; + + return ( + <> + {doc && +
{doc}
+ } + {sdkSupport && +
+
{header}
+ + + + {Object.values(headers).map(header => { + return ; + })} + + + + {Object.entries(sdkSupport).map(([key, supportObj]) => { + return ( + + + {Object.keys(headers).map(k => { + const value = supportObj[k]; + if (supportObj.hasOwnProperty(k)) { + return ; + } + else { + return ; + } + })} + + ); })} - - - - {Object.entries(sdkSupport).map(([key, supportObj]) => { - return ( - - - {Object.keys(headers).map(k => { - const value = supportObj[k]; - if (supportObj.hasOwnProperty(k)) { - return ; - } - else { - return ; - } - })} - - ); - })} - -
{header}
{key}{supportObj[k]}no
{key}{supportObj[k]}no
-
- } - - ); + + + + } + + ); + } }