feat(HAI-069): double flash animation duration from 700ms to 1400ms
- Update useFlashOnIncrease default duration from 700ms to 1400ms - Update CSS count-flash-bg animation duration to 1400ms - Update test assertions to match new 1400ms duration
This commit is contained in:
@@ -28,7 +28,7 @@ describe("useFlashOnIncrease", () => {
|
||||
|
||||
it("resets flashing after duration", () => {
|
||||
const { result, rerender } = renderHook(
|
||||
({ count }) => useFlashOnIncrease(count, 700),
|
||||
({ count }) => useFlashOnIncrease(count, 1400),
|
||||
{ initialProps: { count: 3 } },
|
||||
);
|
||||
|
||||
@@ -36,7 +36,7 @@ describe("useFlashOnIncrease", () => {
|
||||
expect(result.current).toBe(true);
|
||||
|
||||
act(() => {
|
||||
vi.advanceTimersByTime(700);
|
||||
vi.advanceTimersByTime(1400);
|
||||
});
|
||||
expect(result.current).toBe(false);
|
||||
});
|
||||
|
||||
@@ -6,10 +6,10 @@ import { useRef, useState, useEffect } from "react";
|
||||
*
|
||||
* - Does NOT flash on initial render (only on subsequent increases).
|
||||
* - Does NOT flash when count decreases or stays the same.
|
||||
* - Resets after `duration` ms (default 700ms).
|
||||
* - Resets after `duration` ms (default 1400ms).
|
||||
* - Cleans up timers on unmount.
|
||||
*/
|
||||
export function useFlashOnIncrease(count: number, duration = 700): boolean {
|
||||
export function useFlashOnIncrease(count: number, duration = 1400): boolean {
|
||||
const prevRef = useRef<number | null>(null);
|
||||
const [flashing, setFlashing] = useState(false);
|
||||
const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
@@ -168,7 +168,7 @@ html, body {
|
||||
}
|
||||
|
||||
.column-count.count-flash {
|
||||
animation: count-flash-bg 700ms ease-out;
|
||||
animation: count-flash-bg 1400ms ease-out;
|
||||
}
|
||||
|
||||
.column-desc {
|
||||
|
||||
Reference in New Issue
Block a user