mirror of
https://github.com/wassname/talk.git
synced 2026-07-10 21:44:49 +08:00
26 lines
536 B
TypeScript
26 lines
536 B
TypeScript
import { Component } from "react";
|
|
|
|
import resizePopup from "../dom/resizePopup";
|
|
|
|
/**
|
|
* A container that adapts the window height to the current body size
|
|
* when this is mounted or updated.
|
|
*/
|
|
export default class AutoHeightContainer extends Component {
|
|
private updateWindowSize() {
|
|
window.requestAnimationFrame(() => setTimeout(resizePopup, 0));
|
|
}
|
|
|
|
public componentDidMount() {
|
|
this.updateWindowSize();
|
|
}
|
|
|
|
public componentDidUpdate() {
|
|
this.updateWindowSize();
|
|
}
|
|
|
|
public render() {
|
|
return null;
|
|
}
|
|
}
|