remove new-lines between methods in classes
This commit is contained in:
@@ -21,16 +21,13 @@ class BaseAnimation extends React.PureComponent<AnimationProps, AnimationState>
|
||||
width: undefined,
|
||||
};
|
||||
private _timeout = undefined as number;
|
||||
|
||||
public componentDidMount(): void {
|
||||
this._updateAnimationSize();
|
||||
window.addEventListener('resize', this._handleResize);
|
||||
}
|
||||
|
||||
public componentWillUnmount(): void {
|
||||
window.removeEventListener('resize', this._handleResize);
|
||||
}
|
||||
|
||||
public render(): React.ReactNode {
|
||||
const { animationData } = this.props;
|
||||
const height = this.state.height || this.props.height;
|
||||
@@ -52,12 +49,10 @@ class BaseAnimation extends React.PureComponent<AnimationProps, AnimationState>
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
||||
private readonly _handleResize = () => {
|
||||
clearTimeout(this._timeout);
|
||||
this._timeout = window.setTimeout(this._updateAnimationSize, 50);
|
||||
};
|
||||
|
||||
private readonly _updateAnimationSize = () => {
|
||||
const windowWidth = window.innerWidth;
|
||||
let width;
|
||||
|
@@ -141,7 +141,6 @@ class Code extends React.Component<CodeProps, CodeState> {
|
||||
// tslint:disable-next-line:no-floating-promises
|
||||
this._onMountAsync();
|
||||
}
|
||||
|
||||
public render(): React.ReactNode {
|
||||
const { language, isLight, isDiff, children, gutterLength, canCopy } = this.props;
|
||||
const { hlCode } = this.state;
|
||||
@@ -174,7 +173,6 @@ class Code extends React.Component<CodeProps, CodeState> {
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
||||
private async _onMountAsync(): Promise<void> {
|
||||
const { language, children, isDiff, gutter, isEtc } = this.props;
|
||||
|
||||
@@ -188,7 +186,6 @@ class Code extends React.Component<CodeProps, CodeState> {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private readonly _handleCopyAsync = async () => {
|
||||
try {
|
||||
if ('clipboard' in navigator) {
|
||||
|
Reference in New Issue
Block a user