remove loading animation for issue layouts

This commit is contained in:
rahulramesha 2024-02-07 18:54:11 +05:30
parent c3172d8450
commit d6effafd7b

View File

@ -75,7 +75,7 @@ const RenderIfVisible: React.FC<Props> = (props) => {
} }
}, [root?.current, intersectionRef, children]); }, [root?.current, intersectionRef, children]);
// Set height after render //Set height after render
useEffect(() => { useEffect(() => {
if (intersectionRef.current && isVisible) { if (intersectionRef.current && isVisible) {
placeholderHeight.current = `${intersectionRef.current.offsetHeight}px`; placeholderHeight.current = `${intersectionRef.current.offsetHeight}px`;
@ -85,7 +85,7 @@ const RenderIfVisible: React.FC<Props> = (props) => {
const child = isVisible ? <>{children}</> : placeholderChildren; const child = isVisible ? <>{children}</> : placeholderChildren;
const style = const style =
isVisible && !pauseHeightUpdateWhileRendering ? {} : { height: placeholderHeight.current, width: "100%" }; isVisible && !pauseHeightUpdateWhileRendering ? {} : { height: placeholderHeight.current, width: "100%" };
const className = isVisible ? classNames : cn(classNames, "animate-pulse bg-custom-background-80"); const className = isVisible ? classNames : cn(classNames, "bg-custom-background-80");
return React.createElement(as, { ref: intersectionRef, style, className }, child); return React.createElement(as, { ref: intersectionRef, style, className }, child);
}; };