diff --git a/src/components/SettlementButton/AnimatedSettlementButton.tsx b/src/components/SettlementButton/AnimatedSettlementButton.tsx index a5f50306dee7..059bd0ec0ae5 100644 --- a/src/components/SettlementButton/AnimatedSettlementButton.tsx +++ b/src/components/SettlementButton/AnimatedSettlementButton.tsx @@ -1,5 +1,4 @@ import React, {useCallback, useEffect, useState} from 'react'; -import {LayoutChangeEvent} from 'react-native'; import Animated, {runOnJS, useAnimatedStyle, useSharedValue, withDelay, withTiming} from 'react-native-reanimated'; import Button from '@components/Button'; import * as Expensicons from '@components/Icon/Expensicons'; @@ -22,7 +21,6 @@ function AnimatedSettlementButton({isPaidAnimationRunning, onAnimationFinish, is const buttonScale = useSharedValue(1); const buttonOpacity = useSharedValue(1); const [isLoading, setIsLoading] = useState(false); - const [buttonWidth, setButtonWidth] = useState(undefined); const buttonStyles = useAnimatedStyle(() => ({ transform: [{scale: buttonScale.get()}], @@ -74,22 +72,12 @@ function AnimatedSettlementButton({isPaidAnimationRunning, onAnimationFinish, is }; }, [isPaidAnimationRunning, onAnimationFinish, buttonScale, buttonOpacity, resetAnimation, isApprovedAnimationRunning]); - const handleLayout = useCallback( - (event: LayoutChangeEvent) => { - const newWidth = event.nativeEvent.layout.width; - if (newWidth !== buttonWidth) { - setButtonWidth(newWidth); - } - }, - [buttonWidth], - ); - return ( {isPaidAnimationRunning || isApprovedAnimationRunning ? (