large performance refactor

This commit is contained in:
jeffvli
2025-11-26 13:54:45 -08:00
parent 948f428546
commit 60cdea6787
32 changed files with 1030 additions and 502 deletions
@@ -42,7 +42,7 @@ const pageVariants: Variants = {
initial: (custom: { isNext: boolean }) => ({ opacity: 0, x: custom.isNext ? 100 : -100 }),
};
export function GridCarousel(props: GridCarouselProps) {
function BaseGridCarousel(props: GridCarouselProps) {
const { cards, hasNextPage, loadNextPage, onNextPage, onPrevPage, rowCount = 1, title } = props;
const { ref, ...cq } = useContainerQuery({
'2xl': 1024,
@@ -192,6 +192,10 @@ export function GridCarousel(props: GridCarouselProps) {
);
}
export const GridCarousel = memo(BaseGridCarousel);
GridCarousel.displayName = 'GridCarousel';
function getCardsToShow(breakpoints: {
isLargerThan2xl: boolean;
isLargerThan3xl: boolean;