aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2019-01-09 17:54:32 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2019-01-09 17:54:32 +0800
commit5868c91cfb54cfa9177572b201d88d1168bf5b06 (patch)
tree1471d8580a3b0bbba7a9fe0b70eac04de0ffcfe9
parentfd034cc1e4475fa18cfa6a6afb79d09931189ecd (diff)
downloaddexon-0x-contracts-5868c91cfb54cfa9177572b201d88d1168bf5b06.tar
dexon-0x-contracts-5868c91cfb54cfa9177572b201d88d1168bf5b06.tar.gz
dexon-0x-contracts-5868c91cfb54cfa9177572b201d88d1168bf5b06.tar.bz2
dexon-0x-contracts-5868c91cfb54cfa9177572b201d88d1168bf5b06.tar.lz
dexon-0x-contracts-5868c91cfb54cfa9177572b201d88d1168bf5b06.tar.xz
dexon-0x-contracts-5868c91cfb54cfa9177572b201d88d1168bf5b06.tar.zst
dexon-0x-contracts-5868c91cfb54cfa9177572b201d88d1168bf5b06.zip
Fix static tests
-rw-r--r--.prettierignore1
-rw-r--r--packages/dev-tools-pages/ts/components/animations/index.tsx10
-rw-r--r--packages/dev-tools-pages/ts/components/code.tsx4
3 files changed, 8 insertions, 7 deletions
diff --git a/.prettierignore b/.prettierignore
index db389bdb9..3ce7713cc 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -10,6 +10,7 @@ lib
/packages/metacoin/src/contract_wrappers
/packages/metacoin/artifacts
/packages/sra-spec/public/
+/packages/dev-tools-pages/ts/**/data.json
package.json
scripts/postpublish_utils.js
packages/sol-cov/test/fixtures/artifacts
diff --git a/packages/dev-tools-pages/ts/components/animations/index.tsx b/packages/dev-tools-pages/ts/components/animations/index.tsx
index c9672db05..8e5421f5c 100644
--- a/packages/dev-tools-pages/ts/components/animations/index.tsx
+++ b/packages/dev-tools-pages/ts/components/animations/index.tsx
@@ -23,10 +23,10 @@ class BaseAnimation extends React.PureComponent<AnimationProps, AnimationState>
private _timeout = undefined as number;
public componentDidMount(): void {
this._updateAnimationSize();
- window.addEventListener('resize', this._handleResize);
+ window.addEventListener('resize', this._handleResize.bind(this));
}
public componentWillUnmount(): void {
- window.removeEventListener('resize', this._handleResize);
+ window.removeEventListener('resize', this._handleResize.bind(this));
}
public render(): React.ReactNode {
const { animationData } = this.props;
@@ -49,11 +49,11 @@ class BaseAnimation extends React.PureComponent<AnimationProps, AnimationState>
</Container>
);
}
- private readonly _handleResize = () => {
+ private _handleResize(): void {
clearTimeout(this._timeout);
- this._timeout = window.setTimeout(this._updateAnimationSize, 50);
+ this._timeout = window.setTimeout(this._updateAnimationSize.bind(this), 50);
}
- private readonly _updateAnimationSize = () => {
+ private _updateAnimationSize(): void {
const windowWidth = window.innerWidth;
let width;
let height;
diff --git a/packages/dev-tools-pages/ts/components/code.tsx b/packages/dev-tools-pages/ts/components/code.tsx
index dbd1a7e3c..71d7a7752 100644
--- a/packages/dev-tools-pages/ts/components/code.tsx
+++ b/packages/dev-tools-pages/ts/components/code.tsx
@@ -164,7 +164,7 @@ class Code extends React.Component<CodeProps, CodeState> {
) : null}
</Base>
{navigator.userAgent !== 'ReactSnap' && canCopy ? (
- <Button onClick={this._handleCopyAsync}>{this.state.didCopy ? 'Copied' : 'Copy'}</Button>
+ <Button onClick={this._handleCopyAsync.bind(this)}>{this.state.didCopy ? 'Copied' : 'Copy'}</Button>
) : null}
</Container>
);
@@ -182,7 +182,7 @@ class Code extends React.Component<CodeProps, CodeState> {
});
}
}
- private readonly _handleCopyAsync = async () => {
+ private async _handleCopyAsync(): Promise<void> {
try {
if ('clipboard' in navigator) {
await (navigator as any).clipboard.writeText(this.props.children);