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 --- packages/website/ts/components/order_json.tsx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'packages/website/ts/components/order_json.tsx') diff --git a/packages/website/ts/components/order_json.tsx b/packages/website/ts/components/order_json.tsx index 340e5d91f..21ec9ba93 100644 --- a/packages/website/ts/components/order_json.tsx +++ b/packages/website/ts/components/order_json.tsx @@ -36,7 +36,7 @@ export class OrderJSON extends React.Component { shareLink: '', }; // tslint:disable-next-line:no-floating-promises - this.setShareLinkAsync(); + this._setShareLinkAsync(); } public render() { const order = utils.generateOrder(this.props.networkId, this.props.exchangeContractIfExists, @@ -88,21 +88,21 @@ export class OrderJSON extends React.Component {
@@ -111,32 +111,32 @@ export class OrderJSON extends React.Component { ); } - private async shareViaTwitterAsync() { + private async _shareViaTwitterAsync() { const tweetText = encodeURIComponent(`Fill my order using the 0x protocol: ${this.state.shareLink}`); window.open(`https://twitter.com/intent/tweet?text=${tweetText}`, 'Share your order', 'width=500,height=400'); } - private async shareViaFacebook() { + private async _shareViaFacebook() { (window as any).FB.ui({ display: 'popup', href: this.state.shareLink, method: 'share', }, _.noop); } - private async shareViaEmailAsync() { + private async _shareViaEmailAsync() { const encodedSubject = encodeURIComponent('Let\'s trade using the 0x protocol'); const encodedBody = encodeURIComponent(`I generated an order with the 0x protocol. You can see and fill it here: ${this.state.shareLink}`); const mailToLink = `mailto:mail@example.org?subject=${encodedSubject}&body=${encodedBody}`; window.open(mailToLink, '_blank'); } - private async setShareLinkAsync() { - const shareLink = await this.generateShareLinkAsync(); + private async _setShareLinkAsync() { + const shareLink = await this._generateShareLinkAsync(); this.setState({ shareLink, }); } - private async generateShareLinkAsync(): Promise { - const longUrl = encodeURIComponent(this.getOrderUrl()); + private async _generateShareLinkAsync(): Promise { + const longUrl = encodeURIComponent(this._getOrderUrl()); const bitlyRequestUrl = `${constants.URL_BITLY_API}/v3/shorten?access_token=${configs.BITLY_ACCESS_TOKEN}&longUrl=${longUrl}`; const response = await fetch(bitlyRequestUrl); @@ -150,7 +150,7 @@ You can see and fill it here: ${this.state.shareLink}`); } return (bodyObj).data.url; } - private getOrderUrl() { + private _getOrderUrl() { const order = utils.generateOrder(this.props.networkId, this.props.exchangeContractIfExists, this.props.sideToAssetToken, this.props.orderExpiryTimestamp, this.props.orderTakerAddress, this.props.orderMakerAddress, this.props.orderMakerFee, this.props.orderTakerFee, -- cgit