Bluesky app fork with some witchin' additions 💫

Increase copied animation lingering time for reduced motion (#6220)

* increase copied animation lingering time for reduced motion

* flip the condition

---------

Co-authored-by: dan <dan.abramov@gmail.com>

authored by

Khuddite
dan
and committed by
GitHub
57464a8f 9247407c

+11 -3
+11 -3
src/screens/Settings/components/CopyButton.tsx
··· 1 1 import React, {useCallback, useEffect, useState} from 'react' 2 2 import {GestureResponderEvent, View} from 'react-native' 3 - import Animated, {FadeOutUp, ZoomIn} from 'react-native-reanimated' 3 + import Animated, { 4 + FadeOutUp, 5 + useReducedMotion, 6 + ZoomIn, 7 + } from 'react-native-reanimated' 4 8 import * as Clipboard from 'expo-clipboard' 5 9 import {Trans} from '@lingui/macro' 6 10 ··· 16 20 }: ButtonProps & {value: string}) { 17 21 const [hasBeenCopied, setHasBeenCopied] = useState(false) 18 22 const t = useTheme() 23 + const isReducedMotionEnabled = useReducedMotion() 19 24 20 25 useEffect(() => { 21 26 if (hasBeenCopied) { 22 - const timeout = setTimeout(() => setHasBeenCopied(false), 100) 27 + const timeout = setTimeout( 28 + () => setHasBeenCopied(false), 29 + isReducedMotionEnabled ? 2000 : 100, 30 + ) 23 31 return () => clearTimeout(timeout) 24 32 } 25 - }, [hasBeenCopied]) 33 + }, [hasBeenCopied, isReducedMotionEnabled]) 26 34 27 35 const onPress = useCallback( 28 36 (evt: GestureResponderEvent) => {