|
|
|
@ -71,6 +71,7 @@ export function Markdown(
|
|
|
|
|
const parent = props.parentRef.current;
|
|
|
|
|
const md = mdRef.current;
|
|
|
|
|
|
|
|
|
|
const checkInView = () => {
|
|
|
|
|
if (parent && md) {
|
|
|
|
|
const parentBounds = parent.getBoundingClientRect();
|
|
|
|
|
const twoScreenHeight = Math.max(500, parentBounds.height * 2);
|
|
|
|
@ -87,6 +88,18 @@ export function Markdown(
|
|
|
|
|
md.getBoundingClientRect().height,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
if (!inView.current) {
|
|
|
|
|
checkInView();
|
|
|
|
|
}
|
|
|
|
|
}, 10);
|
|
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
checkInView();
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|