From cb11aec84df346d5180c7d5874859c1c34f0bf1c Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Wed, 20 Dec 2017 00:44:08 -0500 Subject: Add new underscore-privates rule to @0xproject/tslint-config and fix lint errors --- .../components/dialogs/blockchain_err_dialog.tsx | 24 ++++++------ .../dialogs/eth_weth_conversion_dialog.tsx | 28 +++++++------- .../ts/components/dialogs/ledger_config_dialog.tsx | 44 +++++++++++----------- .../website/ts/components/dialogs/send_dialog.tsx | 26 ++++++------- .../dialogs/track_token_confirmation_dialog.tsx | 6 +-- 5 files changed, 64 insertions(+), 64 deletions(-) (limited to 'packages/website/ts/components/dialogs') diff --git a/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx b/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx index 9a5cd90d7..900d0e193 100644 --- a/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx +++ b/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx @@ -31,7 +31,7 @@ export class BlockchainErrDialog extends React.Component
- {this.renderExplanation(hasWalletAddress)} + {this._renderExplanation(hasWalletAddress)}
); } - private getTitle(hasWalletAddress: boolean) { + private _getTitle(hasWalletAddress: boolean) { if (this.props.blockchainErr === BlockchainErrs.AContractNotDeployedOnNetwork) { return '0x smart contracts not found'; } else if (!hasWalletAddress) { @@ -56,18 +56,18 @@ export class BlockchainErrDialog extends React.Component You were disconnected from the backing Ethereum node. @@ -78,14 +78,14 @@ export class BlockchainErrDialog extends React.Component ); } - private renderUnexpectedErrorExplanation() { + private _renderUnexpectedErrorExplanation() { return (
We encountered an unexpected error. Please try refreshing the page.
); } - private renderNoWalletFoundExplanation() { + private _renderNoWalletFoundExplanation() { return (
@@ -122,7 +122,7 @@ export class BlockchainErrDialog extends React.Component ); } - private renderContractsNotDeployedExplanation() { + private _renderContractsNotDeployedExplanation() { return (
diff --git a/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx b/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx index 700255163..0045a56c3 100644 --- a/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx +++ b/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx @@ -37,13 +37,13 @@ export class EthWethConversionDialog extends , , ]; const title = this.props.direction === Side.Deposit ? 'Wrap ETH' : 'Unwrap WETH'; @@ -55,11 +55,11 @@ export class EthWethConversionDialog extends contentStyle={{width: 448}} open={this.props.isOpen} > - {this.renderConversionDialogBody()} + {this._renderConversionDialogBody()} ); } - private renderConversionDialogBody() { + private _renderConversionDialogBody() { const explanation = this.props.direction === Side.Deposit ? 'Convert your Ether into a tokenized, tradable form.' : 'Convert your Wrapped Ether back into it\'s native form.'; @@ -71,14 +71,14 @@ export class EthWethConversionDialog extends
- {this.renderCurrency(isWrappedVersion)} + {this._renderCurrency(isWrappedVersion)}
- {this.renderCurrency(!isWrappedVersion)} + {this._renderCurrency(!isWrappedVersion)}
: Max @@ -124,7 +124,7 @@ export class EthWethConversionDialog extends
); } - private renderCurrency(isWrappedVersion: boolean) { + private _renderCurrency(isWrappedVersion: boolean) { const name = isWrappedVersion ? 'Wrapped Ether' : 'Ether'; const iconUrl = isWrappedVersion ? '/images/token_icons/ether_erc20.png' : '/images/ether.png'; const symbol = isWrappedVersion ? 'WETH' : 'ETH'; @@ -145,18 +145,18 @@ export class EthWethConversionDialog extends
); } - private onMaxClick() { + private _onMaxClick() { this.setState({ value: this.props.tokenState.balance, }); } - private onValueChange(isValid: boolean, amount?: BigNumber) { + private _onValueChange(isValid: boolean, amount?: BigNumber) { this.setState({ value: amount, hasErrors: !isValid, }); } - private onConvertClick() { + private _onConvertClick() { if (this.state.hasErrors) { this.setState({ shouldShowIncompleteErrs: true, @@ -169,7 +169,7 @@ export class EthWethConversionDialog extends this.props.onComplete(this.props.direction, value); } } - private onCancel() { + private _onCancel() { this.setState({ value: undefined, }); diff --git a/packages/website/ts/components/dialogs/ledger_config_dialog.tsx b/packages/website/ts/components/dialogs/ledger_config_dialog.tsx index ddd1f2cf2..cc68ef2df 100644 --- a/packages/website/ts/components/dialogs/ledger_config_dialog.tsx +++ b/packages/website/ts/components/dialogs/ledger_config_dialog.tsx @@ -62,7 +62,7 @@ export class LedgerConfigDialog extends React.Component, ]; const dialogTitle = this.state.stepIndex === LedgerSteps.CONNECT ? @@ -74,22 +74,22 @@ export class LedgerConfigDialog extends React.Component
{this.state.stepIndex === LedgerSteps.CONNECT && - this.renderConnectStep() + this._renderConnectStep() } {this.state.stepIndex === LedgerSteps.SELECT_ADDRESS && - this.renderSelectAddressStep() + this._renderSelectAddressStep() }
); } - private renderConnectStep() { + private _renderConnectStep() { return (
@@ -113,7 +113,7 @@ export class LedgerConfigDialog extends React.Component {this.state.didConnectFail &&
@@ -124,13 +124,13 @@ export class LedgerConfigDialog extends React.Component ); } - private renderSelectAddressStep() { + private _renderSelectAddressStep() { return (
@@ -139,7 +139,7 @@ export class LedgerConfigDialog extends React.Component - {this.renderAddressTableRows()} + {this._renderAddressTableRows()}
@@ -151,7 +151,7 @@ export class LedgerConfigDialog extends React.Component
@@ -159,14 +159,14 @@ export class LedgerConfigDialog extends React.Component
); } - private renderAddressTableRows() { + private _renderAddressTableRows() { const rows = _.map(this.state.userAddresses, (userAddress: string, i: number) => { const balance = this.state.addressBalances[i]; const addressTooltipId = `address-${userAddress}`; @@ -201,14 +201,14 @@ export class LedgerConfigDialog extends React.Component { + private async _getUserAddressesAsync(): Promise { let userAddresses: string[]; userAddresses = await this.props.blockchain.getUserAccountsAsync(); diff --git a/packages/website/ts/components/dialogs/send_dialog.tsx b/packages/website/ts/components/dialogs/send_dialog.tsx index 0f3516993..9a85ea8b1 100644 --- a/packages/website/ts/components/dialogs/send_dialog.tsx +++ b/packages/website/ts/components/dialogs/send_dialog.tsx @@ -36,14 +36,14 @@ export class SendDialog extends React.Component, , ]; return ( @@ -53,17 +53,17 @@ export class SendDialog extends React.Component - {this.renderSendDialogBody()} + {this._renderSendDialogBody()} ); } - private renderSendDialogBody() { + private _renderSendDialogBody() { return (
); } - private onRecipientChange(recipient?: string) { + private _onRecipientChange(recipient?: string) { this.setState({ shouldShowIncompleteErrs: false, recipient, }); } - private onValueChange(isValid: boolean, amount?: BigNumber) { + private _onValueChange(isValid: boolean, amount?: BigNumber) { this.setState({ isAmountValid: isValid, value: amount, }); } - private onSendClick() { - if (this.hasErrors()) { + private _onSendClick() { + if (this._hasErrors()) { this.setState({ shouldShowIncompleteErrs: true, }); @@ -109,13 +109,13 @@ export class SendDialog extends React.Component, , ]} open={this.props.isOpen} @@ -64,7 +64,7 @@ export class TrackTokenConfirmationDialog extends ); } - private async onTrackConfirmationRespondedAsync(didUserAcceptTracking: boolean) { + private async _onTrackConfirmationRespondedAsync(didUserAcceptTracking: boolean) { if (!didUserAcceptTracking) { this.props.onToggleDialog(didUserAcceptTracking); return; -- cgit v1.2.3