feat: rename variable

This commit is contained in:
Zamitto 2024-12-28 11:28:43 -03:00 committed by GitHub
parent b22b998c29
commit db2688f3a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,7 +15,7 @@ import { RecentGamesBox } from "./recent-games-box";
import { UserStatsBox } from "./user-stats-box";
import { UserLibraryGameCard } from "./user-library-game-card";
const GAME_STAT_ANIMATION_DURATION_IN_MS = 3500;
const GAME_STATS_ANIMATION_DURATION_IN_MS = 3500;
export function ProfileContent() {
const { userProfile, isMe, userStats } = useContext(userProfileContext);
@ -48,13 +48,13 @@ export function ProfileContent() {
if (!isAnimationRunning) return;
statsAnimation.current = requestAnimationFrame(
function animateClosing(time) {
if (time - zero <= GAME_STAT_ANIMATION_DURATION_IN_MS) {
statsAnimation.current = requestAnimationFrame(animateClosing);
function animateGameStats(time) {
if (time - zero <= GAME_STATS_ANIMATION_DURATION_IN_MS) {
statsAnimation.current = requestAnimationFrame(animateGameStats);
} else {
setStatsIndex((index) => index + 1);
zero = performance.now();
statsAnimation.current = requestAnimationFrame(animateClosing);
statsAnimation.current = requestAnimationFrame(animateGameStats);
}
}
);