From 1c7d2a0a772b93a2d551c22f6364a6d7c073c3ef Mon Sep 17 00:00:00 2001 From: leutinatasya Date: Wed, 11 Dec 2024 11:31:38 +0300 Subject: [PATCH] fix: remove comments --- src/components/Sheet/SheetContent.tsx | 48 +++------------------------ 1 file changed, 5 insertions(+), 43 deletions(-) diff --git a/src/components/Sheet/SheetContent.tsx b/src/components/Sheet/SheetContent.tsx index 80eafb9bfb..b7e1efd220 100644 --- a/src/components/Sheet/SheetContent.tsx +++ b/src/components/Sheet/SheetContent.tsx @@ -2,8 +2,6 @@ import React from 'react'; -import debounce from 'lodash/debounce'; - import {Platform, withMobile} from '../mobile'; import type {History, Location, MobileContextProps} from '../mobile'; @@ -78,12 +76,6 @@ class SheetContent extends React.Component this.onResize(), WINDOW_RESIZE_TIMEOUT); - componentDidMount() { this.addListeners(); this.show(); - // this.needHide = false; - // this.isResizing = false; - // this.isMounted = true; const initialHeight = this.getAvailableContentHeight(this.sheetContentHeight); @@ -121,7 +108,6 @@ class SheetContent extends React.Component { - // this.textLog += 'hide there\n'; this.setState({isAnimating: true}, () => { this.setStyles({status: 'hiding'}); this.removeHash(); @@ -363,7 +346,6 @@ class SheetContent extends React.Component HIDE_THRESHOLD && @@ -371,7 +353,6 @@ class SheetContent extends React.Component= ACCELERATION_Y_MIN) || accelerationY > ACCELERATION_Y_MAX ) { - alert('> delte hide'); this.hide(); } else if (deltaY !== 0) { this.show(); @@ -407,15 +388,8 @@ class SheetContent extends React.Component { - // this.textLog += `${this.isResizing} is resizing\n`; - // if (this.isResizing) { - // this.needHide = true; - // return; - // } this.setState({veilTouched: true}); this.hide(); - - // this.textLog += 'veil touched hide\n'; }; private onVeilTransitionEnd = () => { @@ -435,20 +409,19 @@ class SheetContent extends React.Component { - // this.textLog += `${this.state.veilTouched} this.state.veilTouched\n`; - // this.textLog += `${this.isMounted} this.state.inWindowResizeScope\n`; if (this.state.isAnimating) { return; } + this.setState({inWindowResizeScope: true}); if (this.resizeWindowTimer) { window.clearTimeout(this.resizeWindowTimer); } - // this.textLog += 'onResizeWindow\n'; - - this.debouncedOnResize(); + this.resizeWindowTimer = window.setTimeout(() => { + this.onResize(); + }, WINDOW_RESIZE_TIMEOUT); }; private onResize = () => { @@ -456,14 +429,9 @@ class SheetContent extends React.Component { - // this.isResizing = false; - // if (this.needHide) { - // this.textLog += 'needHide\n'; - // this.onVeilClick(); - // } - }); + this.setState({prevSheetHeight: sheetContentHeight, inWindowResizeScope: false}); }; private addListeners() {