diff options
author | Fabio Berger <me@fabioberger.com> | 2018-05-14 17:30:51 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-05-14 17:30:51 +0800 |
commit | c94d1b22754c1d1bf10f0dd2b9c13eea91e17cb6 (patch) | |
tree | 986b220cf80aab8d8e8ef6c4cef8c08be6eeab10 /packages/website/ts/components/portal | |
parent | 7d60356facce60c1d4d80c703bfc565c5c47e73b (diff) | |
parent | 58fa35641d3016ef106496c929e48febcf827dc6 (diff) | |
download | dexon-sol-tools-c94d1b22754c1d1bf10f0dd2b9c13eea91e17cb6.tar dexon-sol-tools-c94d1b22754c1d1bf10f0dd2b9c13eea91e17cb6.tar.gz dexon-sol-tools-c94d1b22754c1d1bf10f0dd2b9c13eea91e17cb6.tar.bz2 dexon-sol-tools-c94d1b22754c1d1bf10f0dd2b9c13eea91e17cb6.tar.lz dexon-sol-tools-c94d1b22754c1d1bf10f0dd2b9c13eea91e17cb6.tar.xz dexon-sol-tools-c94d1b22754c1d1bf10f0dd2b9c13eea91e17cb6.tar.zst dexon-sol-tools-c94d1b22754c1d1bf10f0dd2b9c13eea91e17cb6.zip |
Merge branch 'development' of github.com:0xProject/0x-monorepo into development
* 'development' of github.com:0xProject/0x-monorepo:
Add missing type definitions
Diffstat (limited to 'packages/website/ts/components/portal')
-rw-r--r-- | packages/website/ts/components/portal/portal.tsx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/packages/website/ts/components/portal/portal.tsx b/packages/website/ts/components/portal/portal.tsx index 4cbc65ce4..e572b7911 100644 --- a/packages/website/ts/components/portal/portal.tsx +++ b/packages/website/ts/components/portal/portal.tsx @@ -102,14 +102,14 @@ export class Portal extends React.Component<PortalProps, PortalState> { isLedgerDialogOpen: false, }; } - public componentDidMount() { + public componentDidMount(): void { window.addEventListener('resize', this._throttledScreenWidthUpdate); window.scrollTo(0, 0); } - public componentWillMount() { + public componentWillMount(): void { this._blockchain = new Blockchain(this.props.dispatcher); } - public componentWillUnmount() { + public componentWillUnmount(): void { this._blockchain.destroy(); window.removeEventListener('resize', this._throttledScreenWidthUpdate); // We re-set the entire redux state when the portal is unmounted so that when it is re-rendered @@ -118,7 +118,7 @@ export class Portal extends React.Component<PortalProps, PortalState> { // become disconnected from their backing Ethereum node, changed user accounts, etc...) this.props.dispatcher.resetState(); } - public componentWillReceiveProps(nextProps: PortalProps) { + public componentWillReceiveProps(nextProps: PortalProps): void { if (nextProps.networkId !== this.state.prevNetworkId) { // tslint:disable-next-line:no-floating-promises this._blockchain.networkIdUpdatedFireAndForgetAsync(nextProps.networkId); @@ -144,7 +144,7 @@ export class Portal extends React.Component<PortalProps, PortalState> { }); } } - public render() { + public render(): React.ReactNode { const updateShouldBlockchainErrDialogBeOpen = this.props.dispatcher.updateShouldBlockchainErrDialogBeOpen.bind( this.props.dispatcher, ); @@ -241,7 +241,7 @@ export class Portal extends React.Component<PortalProps, PortalState> { </div> ); } - private _onTokenChosen(tokenAddress: string) { + private _onTokenChosen(tokenAddress: string): void { if (_.isEmpty(tokenAddress)) { this.setState({ tokenManagementState: TokenManagementState.None, @@ -269,28 +269,28 @@ export class Portal extends React.Component<PortalProps, PortalState> { tokenManagementState: TokenManagementState.None, }); } - private _onToggleLedgerDialog() { + private _onToggleLedgerDialog(): void { this.setState({ isLedgerDialogOpen: !this.state.isLedgerDialogOpen, }); } - private _onAddToken() { + private _onAddToken(): void { this.setState({ tokenManagementState: TokenManagementState.Add, }); } - private _onRemoveToken() { + private _onRemoveToken(): void { this.setState({ tokenManagementState: TokenManagementState.Remove, }); } - private _onPortalDisclaimerAccepted() { + private _onPortalDisclaimerAccepted(): void { localStorage.setItem(constants.LOCAL_STORAGE_KEY_ACCEPT_DISCLAIMER, 'set'); this.setState({ isDisclaimerDialogOpen: false, }); } - private _updateScreenWidth() { + private _updateScreenWidth(): void { const newScreenWidth = utils.getScreenWidth(); this.props.dispatcher.updateScreenWidth(newScreenWidth); } |