diff options
author | Fabio Berger <me@fabioberger.com> | 2017-12-22 00:28:06 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-12-22 00:28:06 +0800 |
commit | 3e91773cd94162fca1855638a76d7bd2f510558a (patch) | |
tree | f8dc443b35a6c306d917c17a63724522d4ccd8a1 /packages/website/ts/pages/documentation/method_block.tsx | |
parent | 66cf60f9cb62828e67135835e13b12d8099a66b4 (diff) | |
download | dexon-0x-contracts-3e91773cd94162fca1855638a76d7bd2f510558a.tar.gz dexon-0x-contracts-3e91773cd94162fca1855638a76d7bd2f510558a.tar.zst dexon-0x-contracts-3e91773cd94162fca1855638a76d7bd2f510558a.zip |
Add sectionName prefix to all anchor links in order to fix method name collisions between sections
Diffstat (limited to 'packages/website/ts/pages/documentation/method_block.tsx')
-rw-r--r-- | packages/website/ts/pages/documentation/method_block.tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/website/ts/pages/documentation/method_block.tsx b/packages/website/ts/pages/documentation/method_block.tsx index 5163e03ac..60dfc17db 100644 --- a/packages/website/ts/pages/documentation/method_block.tsx +++ b/packages/website/ts/pages/documentation/method_block.tsx @@ -18,6 +18,7 @@ import {typeDocUtils} from 'ts/utils/typedoc_utils'; interface MethodBlockProps { method: SolidityMethod|TypescriptMethod; + sectionName: string; libraryVersion: string; typeDefinitionByName: TypeDefinitionByName; docsInfo: DocsInfo; @@ -54,7 +55,7 @@ export class MethodBlock extends React.Component<MethodBlockProps, MethodBlockSt return ( <div - id={method.name} + id={`${this.props.sectionName}-${method.name}`} style={{overflow: 'hidden', width: '100%'}} className="pb4" onMouseOver={this.setAnchorVisibility.bind(this, true)} @@ -74,7 +75,7 @@ export class MethodBlock extends React.Component<MethodBlockProps, MethodBlockSt <AnchorTitle headerSize={HeaderSizes.H3} title={method.name} - id={method.name} + id={`${this.props.sectionName}-${method.name}`} shouldShowAnchor={this.state.shouldShowAnchor} /> </div> @@ -82,6 +83,7 @@ export class MethodBlock extends React.Component<MethodBlockProps, MethodBlockSt <code className="hljs"> <MethodSignature method={method} + sectionName={this.props.sectionName} typeDefinitionByName={this.props.typeDefinitionByName} docsInfo={this.props.docsInfo} /> |