Lint fixes.

This commit is contained in:
orangemug 2020-01-23 08:42:20 +00:00
parent 30facc885f
commit 62f3cbe8fb
3 changed files with 57 additions and 48 deletions

View file

@ -10,6 +10,7 @@ export default class DocLabel extends React.Component {
PropTypes.string
]).isRequired,
fieldSpec: PropTypes.object.isRequired,
onToggleDoc: PropTypes.func.isRequired,
}
constructor (props) {

View file

@ -17,6 +17,7 @@ class InputBlock extends React.Component {
children: PropTypes.node.isRequired,
style: PropTypes.object,
onChange: PropTypes.func,
fieldSpec: PropTypes.object,
}
constructor (props) {

View file

@ -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 &&
<div>{doc}</div>
}
{sdkSupport &&
<div className="sdk-support">
<table className="sdk-support__table">
<thead>
<tr>
<th></th>
{Object.values(headers).map(header => {
return <th key={header}>{header}</th>;
const headers = {
js: "JS",
android: "Android",
ios: "iOS",
macos: "macOS",
};
return (
<>
{doc &&
<div>{doc}</div>
}
{sdkSupport &&
<div className="sdk-support">
<table className="sdk-support__table">
<thead>
<tr>
<th></th>
{Object.values(headers).map(header => {
return <th key={header}>{header}</th>;
})}
</tr>
</thead>
<tbody>
{Object.entries(sdkSupport).map(([key, supportObj]) => {
return (
<tr key={key}>
<td>{key}</td>
{Object.keys(headers).map(k => {
const value = supportObj[k];
if (supportObj.hasOwnProperty(k)) {
return <td key={k}>{supportObj[k]}</td>;
}
else {
return <td key={k}>no</td>;
}
})}
</tr>
);
})}
</tr>
</thead>
<tbody>
{Object.entries(sdkSupport).map(([key, supportObj]) => {
return (
<tr key={key}>
<td>{key}</td>
{Object.keys(headers).map(k => {
const value = supportObj[k];
if (supportObj.hasOwnProperty(k)) {
return <td key={k}>{supportObj[k]}</td>;
}
else {
return <td key={k}>no</td>;
}
})}
</tr>
);
})}
</tbody>
</table>
</div>
}
</>
);
</tbody>
</table>
</div>
}
</>
);
}
}