diff options
author | Fabio Berger <me@fabioberger.com> | 2018-08-07 03:28:21 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-08-07 03:28:21 +0800 |
commit | 6182d2c7f60967a978f2b885e63fab067794b452 (patch) | |
tree | 6480c171cf7d45572f54bc0b9797596e8c76b300 /packages/react-docs/src/components/documentation.tsx | |
parent | af90a777c6d6cdd59b4d398b6b0f5051047bc5d3 (diff) | |
download | dexon-sol-tools-6182d2c7f60967a978f2b885e63fab067794b452.tar dexon-sol-tools-6182d2c7f60967a978f2b885e63fab067794b452.tar.gz dexon-sol-tools-6182d2c7f60967a978f2b885e63fab067794b452.tar.bz2 dexon-sol-tools-6182d2c7f60967a978f2b885e63fab067794b452.tar.lz dexon-sol-tools-6182d2c7f60967a978f2b885e63fab067794b452.tar.xz dexon-sol-tools-6182d2c7f60967a978f2b885e63fab067794b452.tar.zst dexon-sol-tools-6182d2c7f60967a978f2b885e63fab067794b452.zip |
Pass in typeDefinitionByName so that type declarations also link to inner-types and show the popover
Diffstat (limited to 'packages/react-docs/src/components/documentation.tsx')
-rw-r--r-- | packages/react-docs/src/components/documentation.tsx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx index d9a7dcd59..1c32b2e16 100644 --- a/packages/react-docs/src/components/documentation.tsx +++ b/packages/react-docs/src/components/documentation.tsx @@ -225,12 +225,16 @@ export class Documentation extends React.Component<DocumentationProps, Documenta key={`type-${customType.name}`} customType={customType} docsInfo={this.props.docsInfo} + typeDefinitionByName={typeDefinitionByName} /> ); }); const sortedProperties = _.sortBy(docSection.properties, 'name'); - const propertyDefs = _.map(sortedProperties, this._renderProperty.bind(this, sectionName)); + const propertyDefs = _.map( + sortedProperties, + this._renderProperty.bind(this, sectionName, typeDefinitionByName), + ); const sortedMethods = _.sortBy(docSection.methods, 'name'); const methodDefs = _.map(sortedMethods, method => { @@ -349,7 +353,11 @@ export class Documentation extends React.Component<DocumentationProps, Documenta }); return <div>{constructorDefs}</div>; } - private _renderProperty(sectionName: string, property: Property): React.ReactNode { + private _renderProperty( + sectionName: string, + typeDefinitionByName: TypeDefinitionByName, + property: Property, + ): React.ReactNode { return ( <PropertyBlock key={`property-${property.name}-${property.type.name}`} @@ -358,6 +366,7 @@ export class Documentation extends React.Component<DocumentationProps, Documenta docsInfo={this.props.docsInfo} sourceUrl={this.props.sourceUrl} selectedVersion={this.props.selectedVersion} + typeDefinitionByName={typeDefinitionByName} /> ); } |