Fix StoryViewer and update spring animations

This commit is contained in:
Jamie Kyle 2024-09-04 09:33:58 -07:00 committed by GitHub
parent ee0090bb84
commit 8c770934e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 34 additions and 15 deletions

View file

@ -13,6 +13,7 @@ import type { LocalizerType, ThemeType } from '../../types/Util';
import type { ConversationType } from '../../state/ducks/conversations';
import type { PreferredBadgeSelectorType } from '../../state/selectors/badges';
import { drop } from '../../util/drop';
import { useReducedMotion } from '../../hooks/useReducedMotion';
const MAX_AVATARS_COUNT = 3;
@ -87,9 +88,11 @@ function TypingBubbleAvatar({
i18n: LocalizerType;
theme: ThemeType;
}): ReactElement | null {
const reducedMotion = useReducedMotion();
// eslint-disable-next-line react-hooks/exhaustive-deps -- FIXME
const [springProps, springApi] = useSpring(
{
immediate: reducedMotion,
config: SPRING_CONFIG,
from: shouldAnimate
? AVATAR_ANIMATION_PROPS[visible ? 'hidden' : 'visible']