Skip to content

Commit

Permalink
fix: commenting all extra code
Browse files Browse the repository at this point in the history
  • Loading branch information
mournfulCoroner committed Dec 11, 2024
1 parent aa0f2ba commit 63677b1
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions src/components/Sheet/SheetContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const ACCELERATION_Y_MAX = 0.08;
const ACCELERATION_Y_MIN = -0.02;
// 90% from viewport
const MAX_CONTENT_HEIGHT_FROM_VIEWPORT_COEFFICIENT = 0.9;
const WINDOW_RESIZE_TIMEOUT = 100;
const WINDOW_RESIZE_TIMEOUT = 50;

let hashHistory: string[] = [];

Expand Down Expand Up @@ -101,9 +101,9 @@ class SheetContent extends React.Component<SheetContentInnerProps, SheetContentS
componentDidMount() {
this.addListeners();
this.show();
this.needHide = false;
this.isResizing = false;
this.isMounted = true;
// this.needHide = false;
// this.isResizing = false;
// this.isMounted = true;

const initialHeight = this.getAvailableContentHeight(this.sheetContentHeight);

Expand All @@ -121,7 +121,7 @@ class SheetContent extends React.Component<SheetContentInnerProps, SheetContentS
}

if ((prevProps.visible && !visible) || this.shouldClose(prevProps)) {
this.textLog += 'componentDidupdate';
// this.textLog += 'componentDidupdate';
this.hide();
}

Expand All @@ -132,8 +132,8 @@ class SheetContent extends React.Component<SheetContentInnerProps, SheetContentS

componentWillUnmount() {
this.removeListeners();
this.isMounted = false;
alert(this.textLog);
// this.isMounted = false;
// alert(this.textLog);
}

render() {
Expand Down Expand Up @@ -276,7 +276,7 @@ class SheetContent extends React.Component<SheetContentInnerProps, SheetContentS
};

private hide = () => {
this.textLog += 'hide there\n';
// this.textLog += 'hide there\n';
this.setState({isAnimating: true}, () => {
this.setStyles({status: 'hiding'});
this.removeHash();
Expand Down Expand Up @@ -407,15 +407,15 @@ class SheetContent extends React.Component<SheetContentInnerProps, SheetContentS
};

private onVeilClick = () => {
this.textLog += `${this.isResizing} is resizing\n`;
if (this.isResizing) {
this.needHide = true;
return;
}
// 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';
// this.textLog += 'veil touched hide\n';
};

private onVeilTransitionEnd = () => {
Expand All @@ -435,8 +435,8 @@ class SheetContent extends React.Component<SheetContentInnerProps, SheetContentS
};

private onResizeWindow = () => {
this.textLog += `${this.state.veilTouched} this.state.veilTouched\n`;
this.textLog += `${this.isMounted} this.state.inWindowResizeScope\n`;
// this.textLog += `${this.state.veilTouched} this.state.veilTouched\n`;
// this.textLog += `${this.isMounted} this.state.inWindowResizeScope\n`;
if (this.state.isAnimating) {
return;
}
Expand All @@ -446,7 +446,7 @@ class SheetContent extends React.Component<SheetContentInnerProps, SheetContentS
window.clearTimeout(this.resizeWindowTimer);
}

this.textLog += 'onResizeWindow\n';
// this.textLog += 'onResizeWindow\n';

this.debouncedOnResize();
};
Expand All @@ -456,9 +456,9 @@ class SheetContent extends React.Component<SheetContentInnerProps, SheetContentS
return;
}

this.isResizing = true;
// this.isResizing = true;

this.textLog += 'onResize\n';
// this.textLog += 'onResize\n';

const sheetContentHeight = this.sheetContentHeight;

Expand All @@ -477,11 +477,11 @@ class SheetContent extends React.Component<SheetContentInnerProps, SheetContentS
this.sheetScrollContainerRef.current.style.height = `${availableContentHeight}px`;
this.sheetRef.current.style.transform = `translate3d(0, -${availableContentHeight + this.sheetTopHeight}px, 0)`;
this.setState({prevSheetHeight: sheetContentHeight, inWindowResizeScope: false}, () => {
this.isResizing = false;
if (this.needHide) {
this.textLog += 'needHide\n';
this.onVeilClick();
}
// this.isResizing = false;
// if (this.needHide) {
// this.textLog += 'needHide\n';
// this.onVeilClick();
// }
});
};

Expand Down

0 comments on commit 63677b1

Please sign in to comment.