diff options
author | Fabio Berger <me@fabioberger.com> | 2018-04-12 07:56:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-12 07:56:33 +0800 |
commit | 5eb90697c824f1c98467cdb6cd71dbb94ff70805 (patch) | |
tree | b5e02ec65e8ae5298761f07eae18df145024bb16 /packages/react-docs/src/components | |
parent | c47fb8f9a83d409c092dd7449054fa16cf0fa1c9 (diff) | |
parent | faedd2fa0b2582ea24ca4624e13ea7466de18408 (diff) | |
download | dexon-sol-tools-5eb90697c824f1c98467cdb6cd71dbb94ff70805.tar dexon-sol-tools-5eb90697c824f1c98467cdb6cd71dbb94ff70805.tar.gz dexon-sol-tools-5eb90697c824f1c98467cdb6cd71dbb94ff70805.tar.bz2 dexon-sol-tools-5eb90697c824f1c98467cdb6cd71dbb94ff70805.tar.lz dexon-sol-tools-5eb90697c824f1c98467cdb6cd71dbb94ff70805.tar.xz dexon-sol-tools-5eb90697c824f1c98467cdb6cd71dbb94ff70805.tar.zst dexon-sol-tools-5eb90697c824f1c98467cdb6cd71dbb94ff70805.zip |
Merge pull request #519 from 0xProject/fix/docImprovements
Doc fixes and improvements
Diffstat (limited to 'packages/react-docs/src/components')
4 files changed, 4 insertions, 4 deletions
diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx index 14fe175cf..800892dc8 100644 --- a/packages/react-docs/src/components/documentation.tsx +++ b/packages/react-docs/src/components/documentation.tsx @@ -337,7 +337,7 @@ export class Documentation extends React.Component<DocumentationProps, Documenta return ( <div key={`property-${property.name}-${property.type.name}`} className="pb3"> <code className={`hljs ${constants.TYPE_TO_SYNTAX[this.props.docsInfo.type]}`}> - {property.name}: + {property.name}:{' '} <Type type={property.type} sectionName={sectionName} docsInfo={this.props.docsInfo} /> </code> {property.source && ( diff --git a/packages/react-docs/src/components/interface.tsx b/packages/react-docs/src/components/interface.tsx index 541e164e3..bdfdf47c4 100644 --- a/packages/react-docs/src/components/interface.tsx +++ b/packages/react-docs/src/components/interface.tsx @@ -19,7 +19,7 @@ export function Interface(props: InterfaceProps) { return ( <span key={`property-${property.name}-${property.type}-${type.name}`}> {property.name}:{' '} - {property.type.typeDocType !== TypeDocTypes.Reflection ? ( + {property.type && property.type.typeDocType !== TypeDocTypes.Reflection ? ( <Type type={property.type} sectionName={props.sectionName} docsInfo={props.docsInfo} /> ) : ( <Signature @@ -27,7 +27,6 @@ export function Interface(props: InterfaceProps) { returnType={property.type.method.returnType} parameters={property.type.method.parameters} typeParameter={property.type.method.typeParameter} - callPath={property.type.method.callPath} sectionName={props.sectionName} shouldHideMethodName={true} shouldUseArrowSyntax={true} diff --git a/packages/react-docs/src/components/signature.tsx b/packages/react-docs/src/components/signature.tsx index 83fb1e246..1d3c90261 100644 --- a/packages/react-docs/src/components/signature.tsx +++ b/packages/react-docs/src/components/signature.tsx @@ -91,6 +91,7 @@ function renderParameters( ) { const params = _.map(parameters, (p: Parameter) => { const isOptional = p.isOptional; + const hasDefaultValue = !_.isUndefined(p.defaultValue); const type = ( <Type type={p.type} @@ -103,6 +104,7 @@ function renderParameters( <span key={`param-${p.type}-${p.name}`}> {p.name} {isOptional && '?'}: {type} + {hasDefaultValue && ` = ${p.defaultValue}`} </span> ); }); diff --git a/packages/react-docs/src/components/type.tsx b/packages/react-docs/src/components/type.tsx index fd4562ce3..2b7b49672 100644 --- a/packages/react-docs/src/components/type.tsx +++ b/packages/react-docs/src/components/type.tsx @@ -109,7 +109,6 @@ export function Type(props: TypeProps): any { returnType={type.method.returnType} parameters={type.method.parameters} typeParameter={type.method.typeParameter} - callPath={type.method.callPath} sectionName={props.sectionName} shouldHideMethodName={true} shouldUseArrowSyntax={true} |