Skip to content

Commit

Permalink
fix: remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mournfulCoroner committed Dec 10, 2024
1 parent 848c35f commit 0606183
Showing 1 changed file with 1 addition and 36 deletions.
37 changes: 1 addition & 36 deletions src/components/Sheet/SheetContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@ class SheetContent extends React.Component<SheetContentInnerProps, SheetContentS
observer: ResizeObserver | null = null;
resizeWindowTimer: number | null = null;

// isMounted = false;
// isResizing = false;
// needHide = false;

// textLog = '';

state: SheetContentState = {
startScrollTop: 0,
startY: 0,
Expand All @@ -101,9 +95,6 @@ class SheetContent extends React.Component<SheetContentInnerProps, SheetContentS
componentDidMount() {
this.addListeners();
this.show();
// this.needHide = false;
// this.isResizing = false;
// this.isMounted = true;

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

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

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

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

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

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

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

private onVeilClick = () => {
// 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 = () => {
Expand All @@ -433,8 +413,6 @@ 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`;
if (this.state.veilTouched) {
return;
}
Expand All @@ -444,8 +422,6 @@ class SheetContent extends React.Component<SheetContentInnerProps, SheetContentS
window.clearTimeout(this.resizeWindowTimer);
}

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

this.debouncedOnResize();
};

Expand All @@ -454,14 +430,9 @@ class SheetContent extends React.Component<SheetContentInnerProps, SheetContentS
return;
}

// this.isResizing = true;

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

const sheetContentHeight = this.sheetContentHeight;

if (sheetContentHeight === this.state.prevSheetHeight && !this.state.inWindowResizeScope) {
// this.isResizing = false;
return;
}

Expand All @@ -474,13 +445,7 @@ 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.setState({prevSheetHeight: sheetContentHeight, inWindowResizeScope: false});
};

private addListeners() {
Expand Down

0 comments on commit 0606183

Please sign in to comment.