mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-29 04:44:23 +01:00
performance table rewrite and shared sort direction
This commit is contained in:
38 files changed
+965
-874
No files matched your search
@@ -1,14 +1,31 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
import { InlineSkeleton } from "../InlineSkeleton";
|
||||
import { Skeleton } from "../Skeleton";
|
||||
import styles from "./index.module.css";
|
||||
|
||||
type TankCardProps = {
|
||||
compact?: boolean;
|
||||
onIntersection?: () => void;
|
||||
};
|
||||
|
||||
export const TankCardSkeleton = ({ compact }: TankCardProps) => {
|
||||
export const TankCardSkeleton = ({ compact, onIntersection }: TankCardProps) => {
|
||||
const wrapper = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (!onIntersection) return;
|
||||
|
||||
const observer = new IntersectionObserver(([entry]) => {
|
||||
if (entry.isIntersecting) onIntersection();
|
||||
});
|
||||
|
||||
observer.observe(wrapper.current!);
|
||||
|
||||
return () => observer.disconnect();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={wrapper}
|
||||
className={styles.wrapper}
|
||||
data-compact={compact}
|
||||
style={{
|
||||
|
||||
Reference in new issue
Block a user