Added missing Type component

This commit is contained in:
Olivier Guyot
2019-09-24 10:50:52 +02:00
parent 6929cb3001
commit 2ad39cf69e
2 changed files with 20695 additions and 0 deletions

20668
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

27
site/components/Type.jsx Normal file
View File

@@ -0,0 +1,27 @@
import {object} from 'prop-types';
import React from 'react';
import Parameter from './Parameter';
function Type({longName, module, helper}) {
const type = helper.getTypeDef(longName);
if (!type) {
return <code>{longName}</code>;
}
return (
<div>
<code>{type.doc.type.names}</code>
<ul>
{type.doc.properties && type.doc.properties.map(prop => <Parameter param={prop} module={module} helper={helper} />)}
</ul>
</div>
);
}
Type.propTypes = {
longName: object.isRequired,
module: object.isRequired,
helper: object.isRequired
};
export default Type;