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/documentation.tsx | |
parent | 66cf60f9cb62828e67135835e13b12d8099a66b4 (diff) | |
download | dexon-0x-contracts-3e91773cd94162fca1855638a76d7bd2f510558a.tar dexon-0x-contracts-3e91773cd94162fca1855638a76d7bd2f510558a.tar.gz dexon-0x-contracts-3e91773cd94162fca1855638a76d7bd2f510558a.tar.bz2 dexon-0x-contracts-3e91773cd94162fca1855638a76d7bd2f510558a.tar.lz dexon-0x-contracts-3e91773cd94162fca1855638a76d7bd2f510558a.tar.xz 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/documentation.tsx')
-rw-r--r-- | packages/website/ts/pages/documentation/documentation.tsx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/packages/website/ts/pages/documentation/documentation.tsx b/packages/website/ts/pages/documentation/documentation.tsx index a40889872..4d3607d76 100644 --- a/packages/website/ts/pages/documentation/documentation.tsx +++ b/packages/website/ts/pages/documentation/documentation.tsx @@ -195,6 +195,7 @@ export class Documentation extends const typeDefs = _.map(sortedTypes, customType => { return ( <TypeDefinition + sectionName={sectionName} key={`type-${customType.name}`} customType={customType} docsInfo={this.props.docsInfo} @@ -203,7 +204,7 @@ export class Documentation extends }); const sortedProperties = _.sortBy(docSection.properties, 'name'); - const propertyDefs = _.map(sortedProperties, this.renderProperty.bind(this)); + const propertyDefs = _.map(sortedProperties, this.renderProperty.bind(this, sectionName)); const sortedMethods = _.sortBy(docSection.methods, 'name'); const methodDefs = _.map(sortedMethods, method => { @@ -217,6 +218,7 @@ export class Documentation extends <EventDefinition key={`event-${event.name}-${i}`} event={event} + sectionName={sectionName} docsInfo={this.props.docsInfo} /> ); @@ -311,14 +313,19 @@ export class Documentation extends </div> ); } - private renderProperty(property: Property): React.ReactNode { + private renderProperty(sectionName: string, property: Property): React.ReactNode { return ( <div key={`property-${property.name}-${property.type.name}`} className="pb3" > <code className="hljs"> - {property.name}: <Type type={property.type} docsInfo={this.props.docsInfo} /> + {property.name}: + <Type + type={property.type} + sectionName={sectionName} + docsInfo={this.props.docsInfo} + /> </code> {property.source && <SourceLink @@ -342,6 +349,7 @@ export class Documentation extends return ( <MethodBlock key={`method-${method.name}-${sectionName}`} + sectionName={sectionName} method={method} typeDefinitionByName={typeDefinitionByName} libraryVersion={this.props.docsVersion} |