From 1e13e927d022ff9b5eb4297430e13c2a79fa4508 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 11 Apr 2018 17:36:01 +0900 Subject: Add missing space in property declaration --- packages/react-docs/src/components/documentation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/react-docs/src/components/documentation.tsx') diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx index 14fe175cf..800892dc8 100644 --- a/packages/react-docs/src/components/documentation.tsx +++ b/packages/react-docs/src/components/documentation.tsx @@ -337,7 +337,7 @@ export class Documentation extends React.Component - {property.name}: + {property.name}:{' '} {property.source && ( -- cgit v1.2.3 From 1a36459ab84d538eef18b6c009fdec4d09cb3aef Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 4 May 2018 22:41:39 +0200 Subject: Fix property name --- packages/react-docs/src/components/documentation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/react-docs/src/components/documentation.tsx') diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx index 800892dc8..0a525f702 100644 --- a/packages/react-docs/src/components/documentation.tsx +++ b/packages/react-docs/src/components/documentation.tsx @@ -91,7 +91,7 @@ export class Documentation extends React.Component Date: Fri, 11 May 2018 17:38:51 +0200 Subject: Add missing type definitions --- packages/react-docs/src/components/documentation.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'packages/react-docs/src/components/documentation.tsx') diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx index 0a525f702..25687db67 100644 --- a/packages/react-docs/src/components/documentation.tsx +++ b/packages/react-docs/src/components/documentation.tsx @@ -71,19 +71,19 @@ export class Documentation extends React.Component ); } - private _renderLoading(mainContainersStyles: React.CSSProperties) { + private _renderLoading(mainContainersStyles: React.CSSProperties): React.ReactNode { return (
); } - private _renderNetworkBadgesIfExists(sectionName: string) { + private _renderNetworkBadgesIfExists(sectionName: string): React.ReactNode { if (this.props.docsInfo.type !== SupportedDocJson.Doxity) { return null; } @@ -368,17 +368,17 @@ export class Documentation extends React.Component ); } - private _onSidebarHover(event: React.FormEvent) { + private _onSidebarHover(event: React.FormEvent): void { this.setState({ isHoveringSidebar: true, }); } - private _onSidebarHoverOff() { + private _onSidebarHoverOff(): void { this.setState({ isHoveringSidebar: false, }); } - private _onHashChanged(event: any) { + private _onHashChanged(event: any): void { const hash = window.location.hash.slice(1); sharedUtils.scrollToHash(hash, sharedConstants.SCROLL_CONTAINER_ID); } -- cgit v1.2.3 From 9778695b4ad1fd999eb79b01c768a2f2b9938917 Mon Sep 17 00:00:00 2001 From: fragosti Date: Mon, 4 Jun 2018 19:48:21 -0700 Subject: Try enabling no-unused-variable... --- packages/react-docs/src/components/documentation.tsx | 4 ---- 1 file changed, 4 deletions(-) (limited to 'packages/react-docs/src/components/documentation.tsx') diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx index 25687db67..2b021f04c 100644 --- a/packages/react-docs/src/components/documentation.tsx +++ b/packages/react-docs/src/components/documentation.tsx @@ -3,7 +3,6 @@ import { constants as sharedConstants, EtherscanLinkSuffixes, MarkdownSection, - MenuSubsectionsBySection, NestedSidebarMenu, Networks, SectionHeader, @@ -13,13 +12,11 @@ import { import * as _ from 'lodash'; import CircularProgress from 'material-ui/CircularProgress'; import * as React from 'react'; -import { scroller } from 'react-scroll'; import { DocsInfo } from '../docs_info'; import { AddressByContractName, DocAgnosticFormat, - DoxityDocObj, Event, Property, SolidityMethod, @@ -29,7 +26,6 @@ import { TypescriptMethod, } from '../types'; import { constants } from '../utils/constants'; -import { utils } from '../utils/utils'; import { Badge } from './badge'; import { Comment } from './comment'; -- cgit v1.2.3 From e1879ef4d91fc58203d9748eca38695b79c43674 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 11 Jun 2018 23:42:30 +0200 Subject: Fix no-unused-variable tslint rule to include parameters and fix issues --- packages/react-docs/src/components/documentation.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'packages/react-docs/src/components/documentation.tsx') diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx index 2b021f04c..a4e6f4f6e 100644 --- a/packages/react-docs/src/components/documentation.tsx +++ b/packages/react-docs/src/components/documentation.tsx @@ -73,7 +73,7 @@ export class Documentation extends React.Component ); } - private _onSidebarHover(event: React.FormEvent): void { + private _onSidebarHover(_event: React.FormEvent): void { this.setState({ isHoveringSidebar: true, }); @@ -374,7 +374,7 @@ export class Documentation extends React.Component Date: Mon, 9 Jul 2018 19:05:38 +0200 Subject: Add ability to nest doc ref markdown under specific versions --- packages/react-docs/src/components/documentation.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'packages/react-docs/src/components/documentation.tsx') diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx index a4e6f4f6e..7030001e8 100644 --- a/packages/react-docs/src/components/documentation.tsx +++ b/packages/react-docs/src/components/documentation.tsx @@ -12,6 +12,7 @@ import { import * as _ from 'lodash'; import CircularProgress from 'material-ui/CircularProgress'; import * as React from 'react'; +import * as semver from 'semver'; import { DocsInfo } from '../docs_info'; import { @@ -180,7 +181,14 @@ export class Documentation extends React.Component { + return semver.lte(mdVersion, this.props.selectedVersion); + }); + const sortedEligibleVersions = eligibleVersions.sort(semver.rcompare.bind(semver)); + const closestVersion = sortedEligibleVersions[0]; + const markdownFileIfExists = this.props.docsInfo.sectionNameToMarkdownByVersion[closestVersion][sectionName]; if (!_.isUndefined(markdownFileIfExists)) { return ( Date: Mon, 9 Jul 2018 19:53:54 +0200 Subject: Remove comment and add assertion --- packages/react-docs/src/components/documentation.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'packages/react-docs/src/components/documentation.tsx') diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx index 7030001e8..ff33220d2 100644 --- a/packages/react-docs/src/components/documentation.tsx +++ b/packages/react-docs/src/components/documentation.tsx @@ -182,10 +182,16 @@ export class Documentation extends React.Component { return semver.lte(mdVersion, this.props.selectedVersion); }); + if (_.isEmpty(eligibleVersions)) { + throw new Error( + `No eligible markdown sections found for ${this.props.docsInfo.displayName} version ${ + this.props.selectedVersion + }.`, + ); + } const sortedEligibleVersions = eligibleVersions.sort(semver.rcompare.bind(semver)); const closestVersion = sortedEligibleVersions[0]; const markdownFileIfExists = this.props.docsInfo.sectionNameToMarkdownByVersion[closestVersion][sectionName]; -- cgit v1.2.3