Added missing Type component
This commit is contained in:
20668
package-lock.json
generated
Normal file
20668
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
27
site/components/Type.jsx
Normal file
27
site/components/Type.jsx
Normal 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;
|
||||
Reference in New Issue
Block a user