aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/pages/shared
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2017-12-20 13:44:08 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-12-20 22:30:25 +0800
commitcb11aec84df346d5180c7d5874859c1c34f0bf1c (patch)
treeb959a65bdcfc3e8b01dca1bc160f93a0df8a4bf9 /packages/website/ts/pages/shared
parent972e1675f6490bc10e8d9fd64cce2f7945cd4840 (diff)
downloaddexon-0x-contracts-cb11aec84df346d5180c7d5874859c1c34f0bf1c.tar.gz
dexon-0x-contracts-cb11aec84df346d5180c7d5874859c1c34f0bf1c.tar.zst
dexon-0x-contracts-cb11aec84df346d5180c7d5874859c1c34f0bf1c.zip
Add new underscore-privates rule to @0xproject/tslint-config and fix lint errors
Diffstat (limited to 'packages/website/ts/pages/shared')
-rw-r--r--packages/website/ts/pages/shared/anchor_title.tsx6
-rw-r--r--packages/website/ts/pages/shared/markdown_section.tsx6
-rw-r--r--packages/website/ts/pages/shared/nested_sidebar_menu.tsx22
-rw-r--r--packages/website/ts/pages/shared/section_header.tsx6
-rw-r--r--packages/website/ts/pages/shared/version_drop_down.tsx8
5 files changed, 24 insertions, 24 deletions
diff --git a/packages/website/ts/pages/shared/anchor_title.tsx b/packages/website/ts/pages/shared/anchor_title.tsx
index 0a3674fd9..0c1e8f4b7 100644
--- a/packages/website/ts/pages/shared/anchor_title.tsx
+++ b/packages/website/ts/pages/shared/anchor_title.tsx
@@ -79,14 +79,14 @@ export class AnchorTitle extends React.Component<AnchorTitleProps, AnchorTitleSt
className="zmdi zmdi-link"
onClick={utils.setUrlHash.bind(utils, this.props.id)}
style={{...styles.anchor, opacity}}
- onMouseOver={this.setHoverState.bind(this, true)}
- onMouseOut={this.setHoverState.bind(this, false)}
+ onMouseOver={this._setHoverState.bind(this, true)}
+ onMouseOut={this._setHoverState.bind(this, false)}
/>
</ScrollLink>
</div>
);
}
- private setHoverState(isHovering: boolean) {
+ private _setHoverState(isHovering: boolean) {
this.setState({
isHovering,
});
diff --git a/packages/website/ts/pages/shared/markdown_section.tsx b/packages/website/ts/pages/shared/markdown_section.tsx
index 8686e80b6..e81920fc3 100644
--- a/packages/website/ts/pages/shared/markdown_section.tsx
+++ b/packages/website/ts/pages/shared/markdown_section.tsx
@@ -35,8 +35,8 @@ export class MarkdownSection extends React.Component<MarkdownSectionProps, Markd
return (
<div
className="pt2 pr3 md-pl2 sm-pl3 overflow-hidden"
- onMouseOver={this.setAnchorVisibility.bind(this, true)}
- onMouseOut={this.setAnchorVisibility.bind(this, false)}
+ onMouseOver={this._setAnchorVisibility.bind(this, true)}
+ onMouseOut={this._setAnchorVisibility.bind(this, false)}
>
<ScrollElement name={id}>
<div className="clearfix">
@@ -69,7 +69,7 @@ export class MarkdownSection extends React.Component<MarkdownSectionProps, Markd
</div>
);
}
- private setAnchorVisibility(shouldShowAnchor: boolean) {
+ private _setAnchorVisibility(shouldShowAnchor: boolean) {
this.setState({
shouldShowAnchor,
});
diff --git a/packages/website/ts/pages/shared/nested_sidebar_menu.tsx b/packages/website/ts/pages/shared/nested_sidebar_menu.tsx
index fcbfaf1cf..60686c0aa 100644
--- a/packages/website/ts/pages/shared/nested_sidebar_menu.tsx
+++ b/packages/website/ts/pages/shared/nested_sidebar_menu.tsx
@@ -61,13 +61,13 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
{finalSectionName.toUpperCase()}
</div>
</ScrollLink>
- {this.renderMenuItems(menuItems)}
+ {this._renderMenuItems(menuItems)}
</div>
);
} else {
return (
<div key={`section-${sectionName}`} >
- {this.renderMenuItems(menuItems)}
+ {this._renderMenuItems(menuItems)}
</div>
);
}
@@ -87,7 +87,7 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
</div>
);
}
- private renderMenuItems(menuItemNames: string[]): React.ReactNode[] {
+ private _renderMenuItems(menuItemNames: string[]): React.ReactNode[] {
const menuItemStyles = this.props.shouldDisplaySectionHeaders ?
styles.menuItemWithHeaders :
styles.menuItemWithoutHeaders;
@@ -105,7 +105,7 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
containerId={constants.DOCS_CONTAINER_ID}
>
<MenuItem
- onTouchTap={this.onMenuItemClick.bind(this, menuItemName)}
+ onTouchTap={this._onMenuItemClick.bind(this, menuItemName)}
style={menuItemStyles}
innerDivStyle={menuItemInnerDivStyles}
>
@@ -114,19 +114,19 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
</span>
</MenuItem>
</ScrollLink>
- {this.renderMenuItemSubsections(menuItemName)}
+ {this._renderMenuItemSubsections(menuItemName)}
</div>
);
});
return menuItems;
}
- private renderMenuItemSubsections(menuItemName: string): React.ReactNode {
+ private _renderMenuItemSubsections(menuItemName: string): React.ReactNode {
if (_.isUndefined(this.props.menuSubsectionsBySection[menuItemName])) {
return null;
}
- return this.renderMenuSubsectionsBySection(menuItemName, this.props.menuSubsectionsBySection[menuItemName]);
+ return this._renderMenuSubsectionsBySection(menuItemName, this.props.menuSubsectionsBySection[menuItemName]);
}
- private renderMenuSubsectionsBySection(menuItemName: string, entityNames: string[]): React.ReactNode {
+ private _renderMenuSubsectionsBySection(menuItemName: string, entityNames: string[]): React.ReactNode {
return (
<ul style={{margin: 0, listStyleType: 'none', paddingLeft: 0}} key={menuItemName}>
{_.map(entityNames, entityName => {
@@ -138,10 +138,10 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
offset={0}
duration={constants.DOCS_SCROLL_DURATION_MS}
containerId={constants.DOCS_CONTAINER_ID}
- onTouchTap={this.onMenuItemClick.bind(this, entityName)}
+ onTouchTap={this._onMenuItemClick.bind(this, entityName)}
>
<MenuItem
- onTouchTap={this.onMenuItemClick.bind(this, menuItemName)}
+ onTouchTap={this._onMenuItemClick.bind(this, menuItemName)}
style={{minHeight: 35}}
innerDivStyle={{paddingLeft: 36, fontSize: 14, lineHeight: '35px'}}
>
@@ -154,7 +154,7 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
</ul>
);
}
- private onMenuItemClick(menuItemName: string): void {
+ private _onMenuItemClick(menuItemName: string): void {
const id = utils.getIdFromName(menuItemName);
utils.setUrlHash(id);
this.props.onMenuItemClick();
diff --git a/packages/website/ts/pages/shared/section_header.tsx b/packages/website/ts/pages/shared/section_header.tsx
index b5119b128..5ea9fc681 100644
--- a/packages/website/ts/pages/shared/section_header.tsx
+++ b/packages/website/ts/pages/shared/section_header.tsx
@@ -28,8 +28,8 @@ export class SectionHeader extends React.Component<SectionHeaderProps, SectionHe
const id = utils.getIdFromName(sectionName);
return (
<div
- onMouseOver={this.setAnchorVisibility.bind(this, true)}
- onMouseOut={this.setAnchorVisibility.bind(this, false)}
+ onMouseOver={this._setAnchorVisibility.bind(this, true)}
+ onMouseOut={this._setAnchorVisibility.bind(this, false)}
>
<ScrollElement name={id}>
<AnchorTitle
@@ -42,7 +42,7 @@ export class SectionHeader extends React.Component<SectionHeaderProps, SectionHe
</div>
);
}
- private setAnchorVisibility(shouldShowAnchor: boolean) {
+ private _setAnchorVisibility(shouldShowAnchor: boolean) {
this.setState({
shouldShowAnchor,
});
diff --git a/packages/website/ts/pages/shared/version_drop_down.tsx b/packages/website/ts/pages/shared/version_drop_down.tsx
index e63ad19cd..8d3322d72 100644
--- a/packages/website/ts/pages/shared/version_drop_down.tsx
+++ b/packages/website/ts/pages/shared/version_drop_down.tsx
@@ -18,14 +18,14 @@ export class VersionDropDown extends React.Component<VersionDropDownProps, Versi
<DropDownMenu
maxHeight={300}
value={this.props.selectedVersion}
- onChange={this.updateSelectedVersion.bind(this)}
+ onChange={this._updateSelectedVersion.bind(this)}
>
- {this.renderDropDownItems()}
+ {this._renderDropDownItems()}
</DropDownMenu>
</div>
);
}
- private renderDropDownItems() {
+ private _renderDropDownItems() {
const items = _.map(this.props.versions, version => {
return (
<MenuItem
@@ -37,7 +37,7 @@ export class VersionDropDown extends React.Component<VersionDropDownProps, Versi
});
return items;
}
- private updateSelectedVersion(e: any, index: number, value: string) {
+ private _updateSelectedVersion(e: any, index: number, value: string) {
window.location.href = `${this.props.docPath}/${value}${window.location.hash}`;
}
}