aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs-example/ts/docs.tsx
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-08-14 09:42:09 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-08-14 09:42:09 +0800
commit88766a02c7e6688e72d5c4c69ce68028b322f154 (patch)
treefa06552a80249e7998691b64df6b3b2827f9f947 /packages/react-docs-example/ts/docs.tsx
parent8162394797342cef268cc8072fc860326974e269 (diff)
parentfadd292ecf367e42154856509d0ea0c20b23f2f1 (diff)
downloaddexon-sol-tools-88766a02c7e6688e72d5c4c69ce68028b322f154.tar
dexon-sol-tools-88766a02c7e6688e72d5c4c69ce68028b322f154.tar.gz
dexon-sol-tools-88766a02c7e6688e72d5c4c69ce68028b322f154.tar.bz2
dexon-sol-tools-88766a02c7e6688e72d5c4c69ce68028b322f154.tar.lz
dexon-sol-tools-88766a02c7e6688e72d5c4c69ce68028b322f154.tar.xz
dexon-sol-tools-88766a02c7e6688e72d5c4c69ce68028b322f154.tar.zst
dexon-sol-tools-88766a02c7e6688e72d5c4c69ce68028b322f154.zip
Merge branch 'development'
Diffstat (limited to 'packages/react-docs-example/ts/docs.tsx')
-rw-r--r--packages/react-docs-example/ts/docs.tsx18
1 files changed, 8 insertions, 10 deletions
diff --git a/packages/react-docs-example/ts/docs.tsx b/packages/react-docs-example/ts/docs.tsx
index eef331813..bb605806f 100644
--- a/packages/react-docs-example/ts/docs.tsx
+++ b/packages/react-docs-example/ts/docs.tsx
@@ -1,4 +1,3 @@
-import * as _ from 'lodash';
import * as React from 'react';
import {
@@ -15,7 +14,7 @@ import * as v0TypeDocJson from './json/0.1.12.json';
import * as v2TypeDocJson from './json/0.2.0.json';
// tslint:disable-next-line:no-implicit-dependencies no-var-requires
-const IntroMarkdown = require('md/introduction');
+const IntroMarkdownV1 = require('md/introduction');
const docSections = {
introduction: 'introduction',
@@ -33,8 +32,10 @@ const docsInfoConfig: DocsInfoConfig = {
web3Wrapper: [docSections.web3Wrapper],
types: [docSections.types],
},
- sectionNameToMarkdown: {
- [docSections.introduction]: IntroMarkdown,
+ sectionNameToMarkdownByVersion: {
+ '0.0.1': {
+ [docSections.introduction]: IntroMarkdownV1,
+ },
},
sectionNameToModulePath: {
[docSections.web3Wrapper]: ['"web3-wrapper/src/index"'],
@@ -94,10 +95,7 @@ export class Docs extends React.Component<DocsProps, DocsState> {
docAgnosticFormat: docsInfo.convertToDocAgnosticFormat(v2TypeDocJson),
};
}
- public render() {
- const menuSubsectionsBySection = _.isUndefined(this.state.docAgnosticFormat)
- ? {}
- : docsInfo.getMenuSubsectionsBySection(this.state.docAgnosticFormat);
+ public render(): React.ReactNode {
return (
<Documentation
selectedVersion={this.state.selectedVersion}
@@ -109,14 +107,14 @@ export class Docs extends React.Component<DocsProps, DocsState> {
/>
);
}
- private _onVersionSelected(semver: string) {
+ private _onVersionSelected(semver: string): void {
const selectedDocJSON = versionToDocJSON[semver];
this.setState({
selectedVersion: semver,
docAgnosticFormat: docsInfo.convertToDocAgnosticFormat(selectedDocJSON as TypeDocNode),
});
}
- private _getSourceUrl() {
+ private _getSourceUrl(): string {
const sourceUrl = `${docsInfoConfig.packageUrl}/blob/@0xproject/web3-wrapper@${
this.state.selectedVersion
}/packages`;