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

@ -14,6 +14,7 @@ import { ModalHost } from './ModalHost';
import { drop } from '../util/drop';
import * as log from '../logging/log';
import { usePrevious } from '../hooks/usePrevious';
import { useReducedMotion } from '../hooks/useReducedMotion';
export type PropsType = {
readonly i18n: LocalizerType;
@ -174,6 +175,8 @@ export function CallingRaisedHandsListButton({
}: CallingRaisedHandsListButtonPropsType): JSX.Element | null {
const [isVisible, setIsVisible] = React.useState(raisedHandsCount > 0);
const reducedMotion = useReducedMotion();
// eslint-disable-next-line react-hooks/exhaustive-deps -- FIXME
const [opacitySpringProps, opacitySpringApi] = useSpring(
{
@ -186,6 +189,7 @@ export function CallingRaisedHandsListButton({
// eslint-disable-next-line react-hooks/exhaustive-deps -- FIXME
const [scaleSpringProps, scaleSpringApi] = useSpring(
{
immediate: reducedMotion,
from: { scale: 0.9 },
to: { scale: 1 },
config: BUTTON_SCALE_SPRING_CONFIG,