[Glitch] Make React Spring respect animation preferences

Port 3aed93711c to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Echo
2025-06-11 18:51:55 +02:00
committed by Claire
parent 180754a14e
commit 3166396a16
8 changed files with 14 additions and 30 deletions

View File

@@ -4,7 +4,6 @@ import { animated, useSpring } from '@react-spring/web';
import UploadFileIcon from '@/material-icons/400-24px/upload_file.svg?react';
import { Icon } from 'flavours/glitch/components/icon';
import { reduceMotion } from 'flavours/glitch/initial_state';
interface UploadProgressProps {
active: boolean;
@@ -20,7 +19,7 @@ export const UploadProgress: React.FC<UploadProgressProps> = ({
const styles = useSpring({
from: { width: '0%' },
to: { width: `${progress}%` },
immediate: reduceMotion || !active, // If this is not active, update the UI immediately.
immediate: !active, // If this is not active, update the UI immediately.
});
if (!active) {
return null;