diff options
author | Fabio Berger <me@fabioberger.com> | 2018-02-28 06:29:22 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-02-28 06:29:22 +0800 |
commit | 97fcfb7f6c62aefa3f3a736f7783529d4e3e0018 (patch) | |
tree | 8b7d202ecceb6f467c94c7a4ce95049b5700b88f /packages/website/ts/pages/documentation/documentation.tsx | |
parent | ecba95250d0bfc5b4ab0950ef490a4f262672e6c (diff) | |
download | dexon-sol-tools-97fcfb7f6c62aefa3f3a736f7783529d4e3e0018.tar dexon-sol-tools-97fcfb7f6c62aefa3f3a736f7783529d4e3e0018.tar.gz dexon-sol-tools-97fcfb7f6c62aefa3f3a736f7783529d4e3e0018.tar.bz2 dexon-sol-tools-97fcfb7f6c62aefa3f3a736f7783529d4e3e0018.tar.lz dexon-sol-tools-97fcfb7f6c62aefa3f3a736f7783529d4e3e0018.tar.xz dexon-sol-tools-97fcfb7f6c62aefa3f3a736f7783529d4e3e0018.tar.zst dexon-sol-tools-97fcfb7f6c62aefa3f3a736f7783529d4e3e0018.zip |
Move more configs into docsInfo and remove logic that does not belong there elsewhere
Diffstat (limited to 'packages/website/ts/pages/documentation/documentation.tsx')
-rw-r--r-- | packages/website/ts/pages/documentation/documentation.tsx | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/packages/website/ts/pages/documentation/documentation.tsx b/packages/website/ts/pages/documentation/documentation.tsx index 74d5afb54..9fe599b6d 100644 --- a/packages/website/ts/pages/documentation/documentation.tsx +++ b/packages/website/ts/pages/documentation/documentation.tsx @@ -24,6 +24,7 @@ import { Property, SolidityMethod, Styles, + SupportedDocJson, TypeDefinitionByName, TypescriptMethod, } from 'ts/types'; @@ -49,6 +50,7 @@ export interface DocumentationProps { docsInfo: DocsInfo; docAgnosticFormat?: DocAgnosticFormat; menuSubsectionsBySection: MenuSubsectionsBySection; + sourceUrl: string; } interface DocumentationState {} @@ -107,7 +109,6 @@ export class Documentation extends React.Component<DocumentationProps, Documenta title={this.props.docsInfo.displayName} topLevelMenu={this.props.docsInfo.getMenu(this.props.docsVersion)} menuSubsectionsBySection={this.props.menuSubsectionsBySection} - docPath={this.props.docsInfo.websitePath} /> </div> </div> @@ -246,7 +247,13 @@ export class Documentation extends React.Component<DocumentationProps, Documenta ); } private _renderNetworkBadgesIfExists(sectionName: string) { - const networkToAddressByContractName = configs.CONTRACT_ADDRESS[this.props.docsVersion]; + if (this.props.docsInfo.type !== SupportedDocJson.Doxity) { + return null; + } + + const networkToAddressByContractName = this.props.docsInfo.contractsByVersionByNetworkId[ + this.props.docsVersion + ]; const badges = _.map( networkToAddressByContractName, (addressByContractName: AddressByContractName, networkName: string) => { @@ -294,8 +301,7 @@ export class Documentation extends React.Component<DocumentationProps, Documenta <SourceLink version={this.props.docsVersion} source={property.source} - baseUrl={this.props.docsInfo.packageUrl} - subPackageName={this.props.docsInfo.subPackageName} + sourceUrl={this.props.sourceUrl} /> )} {property.comment && <Comment comment={property.comment} className="py2" />} @@ -316,6 +322,7 @@ export class Documentation extends React.Component<DocumentationProps, Documenta typeDefinitionByName={typeDefinitionByName} libraryVersion={this.props.docsVersion} docsInfo={this.props.docsInfo} + sourceUrl={this.props.sourceUrl} /> ); } |