Fix tests after ts change
CI Pipeline / test (20) (pull_request) Successful in 2m41s
CI Pipeline / test (18) (pull_request) Successful in 3m21s
CI Pipeline / e2e (chromium) (pull_request) Failing after 1m25s
CI Pipeline / e2e (firefox) (pull_request) Failing after 1m24s
CI Pipeline / e2e (webkit) (pull_request) Failing after 1m24s
CI Pipeline / visual-regression (pull_request) Failing after 1m53s
CI Pipeline / performance (pull_request) Failing after 1m31s
CI Pipeline / lint (pull_request) Failing after 1m5s
CI Pipeline / storybook (pull_request) Successful in 1m36s
CI Pipeline / build (pull_request) Failing after 1m19s

This commit is contained in:
adilallo
2025-12-10 22:43:36 -07:00
parent f6a0673082
commit 92a3337aeb
65 changed files with 262 additions and 313 deletions
+7 -7
View File
@@ -15,7 +15,7 @@ const RelatedArticles = memo<RelatedArticlesProps>(
// Memoize filtered posts to prevent unnecessary re-computations
const filteredPosts = useMemo(
() => relatedPosts.filter((post) => post.slug !== currentPostSlug),
[relatedPosts, currentPostSlug]
[relatedPosts, currentPostSlug],
);
const [currentIndex, setCurrentIndex] = useState(0);
@@ -43,7 +43,7 @@ const RelatedArticles = memo<RelatedArticlesProps>(
document.addEventListener("mousemove", handleMouseMove);
document.addEventListener("mouseup", handleMouseUp);
},
[]
[],
);
// Memoize transform style to prevent unnecessary recalculations
@@ -54,7 +54,7 @@ const RelatedArticles = memo<RelatedArticlesProps>(
: "none",
scrollBehavior: !isMobile ? "smooth" : "auto",
}),
[isMobile, currentIndex]
[isMobile, currentIndex],
);
// Memoize progress bar style calculation
@@ -64,10 +64,10 @@ const RelatedArticles = memo<RelatedArticlesProps>(
index === currentIndex
? `${progress}%`
: index < currentIndex
? "100%"
: "0%",
? "100%"
: "0%",
}),
[currentIndex, progress]
[currentIndex, progress],
);
// Check if we're on mobile (below lg breakpoint)
@@ -165,7 +165,7 @@ const RelatedArticles = memo<RelatedArticlesProps>(
</div>
</section>
);
}
},
);
RelatedArticles.displayName = "RelatedArticles";