diff options
author | Fabio Berger <me@fabioberger.com> | 2017-12-22 05:45:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-22 05:45:22 +0800 |
commit | e884eb9882246398eb576b809e2d18e589ec5f51 (patch) | |
tree | 241b630db5044974cc17130f149ca64728d9c619 /packages/website/ts/pages/documentation/type_definition.tsx | |
parent | cb3582289ff94857d5956bbd71dbf68ee3f42ecf (diff) | |
parent | e01c0f054d2dbb043aec8b4cb8e1c47f83bd5eb9 (diff) | |
download | dexon-sol-tools-e884eb9882246398eb576b809e2d18e589ec5f51.tar dexon-sol-tools-e884eb9882246398eb576b809e2d18e589ec5f51.tar.gz dexon-sol-tools-e884eb9882246398eb576b809e2d18e589ec5f51.tar.bz2 dexon-sol-tools-e884eb9882246398eb576b809e2d18e589ec5f51.tar.lz dexon-sol-tools-e884eb9882246398eb576b809e2d18e589ec5f51.tar.xz dexon-sol-tools-e884eb9882246398eb576b809e2d18e589ec5f51.tar.zst dexon-sol-tools-e884eb9882246398eb576b809e2d18e589ec5f51.zip |
Merge pull request #288 from 0xProject/fix/docLinks
Fix doc anchor link collisions
Diffstat (limited to 'packages/website/ts/pages/documentation/type_definition.tsx')
-rw-r--r-- | packages/website/ts/pages/documentation/type_definition.tsx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/packages/website/ts/pages/documentation/type_definition.tsx b/packages/website/ts/pages/documentation/type_definition.tsx index 036552693..25499a6d0 100644 --- a/packages/website/ts/pages/documentation/type_definition.tsx +++ b/packages/website/ts/pages/documentation/type_definition.tsx @@ -13,6 +13,7 @@ import {colors} from 'ts/utils/colors'; import {utils} from 'ts/utils/utils'; interface TypeDefinitionProps { + sectionName: string; customType: CustomType; shouldAddId?: boolean; docsInfo: DocsInfo; @@ -46,6 +47,7 @@ export class TypeDefinition extends React.Component<TypeDefinitionProps, TypeDef codeSnippet = ( <Interface type={customType} + sectionName={this.props.sectionName} docsInfo={this.props.docsInfo} /> ); @@ -85,9 +87,14 @@ export class TypeDefinition extends React.Component<TypeDefinitionProps, TypeDef type </span> {customType.name} ={' '} {customType.type.typeDocType !== TypeDocTypes.Reflection ? - <Type type={customType.type} docsInfo={this.props.docsInfo} /> : + <Type + type={customType.type} + sectionName={this.props.sectionName} + docsInfo={this.props.docsInfo} + /> : <MethodSignature method={customType.type.method} + sectionName={this.props.sectionName} shouldHideMethodName={true} shouldUseArrowSyntax={true} docsInfo={this.props.docsInfo} @@ -101,7 +108,7 @@ export class TypeDefinition extends React.Component<TypeDefinitionProps, TypeDef throw utils.spawnSwitchErr('type.kindString', customType.kindString); } - const typeDefinitionAnchorId = customType.name; + const typeDefinitionAnchorId = `${this.props.sectionName}-${customType.name}`; return ( <div id={this.props.shouldAddId ? typeDefinitionAnchorId : ''} |