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/interface.tsx | |
parent | af90a777c6d6cdd59b4d398b6b0f5051047bc5d3 (diff) | |
download | dexon-0x-contracts-6182d2c7f60967a978f2b885e63fab067794b452.tar.gz dexon-0x-contracts-6182d2c7f60967a978f2b885e63fab067794b452.tar.zst dexon-0x-contracts-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/interface.tsx')
-rw-r--r-- | packages/react-docs/src/components/interface.tsx | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/packages/react-docs/src/components/interface.tsx b/packages/react-docs/src/components/interface.tsx index 915b4bbc6..eaf57ce93 100644 --- a/packages/react-docs/src/components/interface.tsx +++ b/packages/react-docs/src/components/interface.tsx @@ -2,7 +2,7 @@ import * as _ from 'lodash'; import * as React from 'react'; import { DocsInfo } from '../docs_info'; -import { CustomType } from '../types'; +import { CustomType, TypeDefinitionByName } from '../types'; import { Signature } from './signature'; import { Type } from './type'; @@ -11,6 +11,7 @@ export interface InterfaceProps { type: CustomType; sectionName: string; docsInfo: DocsInfo; + typeDefinitionByName: TypeDefinitionByName; } export const Interface = (props: InterfaceProps) => { @@ -29,9 +30,15 @@ export const Interface = (props: InterfaceProps) => { shouldHideMethodName={true} shouldUseArrowSyntax={true} docsInfo={props.docsInfo} + typeDefinitionByName={props.typeDefinitionByName} /> ) : ( - <Type type={property.type} sectionName={props.sectionName} docsInfo={props.docsInfo} /> + <Type + type={property.type} + sectionName={props.sectionName} + docsInfo={props.docsInfo} + typeDefinitionByName={props.typeDefinitionByName} + /> )}, </span> ); @@ -41,7 +48,13 @@ export const Interface = (props: InterfaceProps) => { const is = type.indexSignature; const param = ( <span key={`indexSigParams-${is.keyName}-${is.keyType}-${type.name}`}> - {is.keyName}: <Type type={is.keyType} sectionName={props.sectionName} docsInfo={props.docsInfo} /> + {is.keyName}:{' '} + <Type + type={is.keyType} + sectionName={props.sectionName} + docsInfo={props.docsInfo} + typeDefinitionByName={props.typeDefinitionByName} + /> </span> ); properties.push( |