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/type_definition.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/type_definition.tsx')
-rw-r--r-- | packages/react-docs/src/components/type_definition.tsx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/packages/react-docs/src/components/type_definition.tsx b/packages/react-docs/src/components/type_definition.tsx index 26fbbf75c..775d9890f 100644 --- a/packages/react-docs/src/components/type_definition.tsx +++ b/packages/react-docs/src/components/type_definition.tsx @@ -4,7 +4,7 @@ import * as _ from 'lodash'; import * as React from 'react'; import { DocsInfo } from '../docs_info'; -import { CustomType, CustomTypeChild, KindString, TypeDocTypes } from '../types'; +import { CustomType, CustomTypeChild, KindString, TypeDocTypes, TypeDefinitionByName } from '../types'; import { constants } from '../utils/constants'; import { Comment } from './comment'; @@ -19,6 +19,7 @@ export interface TypeDefinitionProps { customType: CustomType; shouldAddId?: boolean; docsInfo: DocsInfo; + typeDefinitionByName?: TypeDefinitionByName; } export interface TypeDefinitionState { @@ -44,7 +45,12 @@ export class TypeDefinition extends React.Component<TypeDefinitionProps, TypeDef case KindString.Interface: typePrefix = 'Interface'; codeSnippet = ( - <Interface type={customType} sectionName={this.props.sectionName} docsInfo={this.props.docsInfo} /> + <Interface + type={customType} + sectionName={this.props.sectionName} + docsInfo={this.props.docsInfo} + typeDefinitionByName={this.props.typeDefinitionByName} + /> ); break; @@ -74,6 +80,7 @@ export class TypeDefinition extends React.Component<TypeDefinitionProps, TypeDef type={customType.type} sectionName={this.props.sectionName} docsInfo={this.props.docsInfo} + typeDefinitionByName={this.props.typeDefinitionByName} /> ) : ( <Signature @@ -86,6 +93,7 @@ export class TypeDefinition extends React.Component<TypeDefinitionProps, TypeDef shouldHideMethodName={true} shouldUseArrowSyntax={true} docsInfo={this.props.docsInfo} + typeDefinitionByName={this.props.typeDefinitionByName} /> )} </span> |