mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-02 16:23:48 +03:00
feat: rename variable
This commit is contained in:
parent
b22b998c29
commit
db2688f3a7
@ -15,7 +15,7 @@ import { RecentGamesBox } from "./recent-games-box";
|
|||||||
import { UserStatsBox } from "./user-stats-box";
|
import { UserStatsBox } from "./user-stats-box";
|
||||||
import { UserLibraryGameCard } from "./user-library-game-card";
|
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() {
|
export function ProfileContent() {
|
||||||
const { userProfile, isMe, userStats } = useContext(userProfileContext);
|
const { userProfile, isMe, userStats } = useContext(userProfileContext);
|
||||||
@ -48,13 +48,13 @@ export function ProfileContent() {
|
|||||||
if (!isAnimationRunning) return;
|
if (!isAnimationRunning) return;
|
||||||
|
|
||||||
statsAnimation.current = requestAnimationFrame(
|
statsAnimation.current = requestAnimationFrame(
|
||||||
function animateClosing(time) {
|
function animateGameStats(time) {
|
||||||
if (time - zero <= GAME_STAT_ANIMATION_DURATION_IN_MS) {
|
if (time - zero <= GAME_STATS_ANIMATION_DURATION_IN_MS) {
|
||||||
statsAnimation.current = requestAnimationFrame(animateClosing);
|
statsAnimation.current = requestAnimationFrame(animateGameStats);
|
||||||
} else {
|
} else {
|
||||||
setStatsIndex((index) => index + 1);
|
setStatsIndex((index) => index + 1);
|
||||||
zero = performance.now();
|
zero = performance.now();
|
||||||
statsAnimation.current = requestAnimationFrame(animateClosing);
|
statsAnimation.current = requestAnimationFrame(animateGameStats);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user