From 9d519c10d5a867df0ff066107b0bc198635c4252 Mon Sep 17 00:00:00 2001 From: Philipp Walter Date: Wed, 29 May 2024 12:20:34 +0200 Subject: [PATCH] fix(onboarding): adjust rocket loading duration --- src/screens/Onboarding/Loading.tsx | 9 +++++++-- src/screens/Onboarding/Restoring.tsx | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/screens/Onboarding/Loading.tsx b/src/screens/Onboarding/Loading.tsx index 03244f79d..ddb4c4b3b 100644 --- a/src/screens/Onboarding/Loading.tsx +++ b/src/screens/Onboarding/Loading.tsx @@ -32,9 +32,14 @@ const rocketSize = 256; Animated.addWhitelistedNativeProps({ text: true }); const AnimatedText = Animated.createAnimatedComponent(TextInput); -const LoadingWalletScreen = (): ReactElement => { +const LoadingWalletScreen = ({ + isRestoring = false, +}: { + isRestoring?: boolean; +}): ReactElement => { const { t } = useTranslation('onboarding'); const { width } = useWindowDimensions(); + const animationDuration = isRestoring ? 16000 : 1500; const progressValue = useSharedValue(0); const progressText = useDerivedValue(() => { @@ -46,7 +51,7 @@ const LoadingWalletScreen = (): ReactElement => { useEffect(() => { progressValue.value = withTiming(100, { - duration: 4000, + duration: animationDuration, easing: Easing.linear, }); // eslint-disable-next-line react-hooks/exhaustive-deps diff --git a/src/screens/Onboarding/Restoring.tsx b/src/screens/Onboarding/Restoring.tsx index 7ef58f800..03a7d948a 100644 --- a/src/screens/Onboarding/Restoring.tsx +++ b/src/screens/Onboarding/Restoring.tsx @@ -84,7 +84,7 @@ const RestoringScreen = (): ReactElement => { }, [profile.name, onboardingStep, dispatch]); let color: keyof IColors = 'brand'; - let content = ; + let content = ; if (showRestored || showFailed) { color = showRestored ? 'green' : 'red';