diff --git a/app/init/launch.ts b/app/init/launch.ts index a2df188d4..8ac7c9cc8 100644 --- a/app/init/launch.ts +++ b/app/init/launch.ts @@ -135,12 +135,14 @@ const launchApp = async (props: LaunchProps, resetNavigation = true) => { } } - const onboardingViewed = LocalConfig.ShowOnboarding ? await getOnboardingViewed() : false; + const onboardingViewed = LocalConfig.ShowOnboarding && await getOnboardingViewed(); - if (onboardingViewed) { - return launchToServer(props, resetNavigation); + // if the config value is set and the onboarding has not been seeing yet, show the onboarding + if (LocalConfig.ShowOnboarding && !onboardingViewed) { + return resetToOnboarding(props); } - return resetToOnboarding(props); + + return launchToServer(props, resetNavigation); }; const launchToHome = async (props: LaunchProps) => { diff --git a/app/screens/navigation.ts b/app/screens/navigation.ts index 22484381c..81e7159c8 100644 --- a/app/screens/navigation.ts +++ b/app/screens/navigation.ts @@ -124,6 +124,19 @@ export const bottomSheetModalOptions = (theme: Theme, closeButtonId?: string) => // This locks phones to portrait for all screens while keeps // all orientations available for Tablets. Navigation.setDefaultOptions({ + animations: { + setRoot: { + enter: { + waitForRender: true, + enabled: true, + alpha: { + from: 0, + to: 1, + duration: 300, + }, + }, + }, + }, layout: { orientation: Device.IS_TABLET ? undefined : ['portrait'], }, diff --git a/app/screens/onboarding/index.tsx b/app/screens/onboarding/index.tsx index 7fe18e8e2..6bbfe57e7 100644 --- a/app/screens/onboarding/index.tsx +++ b/app/screens/onboarding/index.tsx @@ -2,7 +2,7 @@ // See LICENSE.txt for license information. import React, {useCallback, useEffect} from 'react'; -import {View, ListRenderItemInfo, useWindowDimensions, SafeAreaView, ScrollView, StyleSheet, Platform} from 'react-native'; +import {View, ListRenderItemInfo, useWindowDimensions, SafeAreaView, ScrollView, StyleSheet, Platform, NativeSyntheticEvent, NativeScrollEvent} from 'react-native'; import {Navigation} from 'react-native-navigation'; import Animated, {useAnimatedRef, useAnimatedScrollHandler, useAnimatedStyle, useDerivedValue, useSharedValue, withTiming} from 'react-native-reanimated'; @@ -60,7 +60,7 @@ const Onboarding = ({ x: (slideIndexToMove * width), animated: true, }); - }, [currentIndex.value]); + }, []); const nextSlide = useCallback(() => { const nextSlideIndex = currentIndex.value + 1; @@ -91,11 +91,9 @@ const Onboarding = ({ ); }, [theme]); - const scrollHandler = useAnimatedScrollHandler({ - onScroll: (event) => { - scrollX.value = event.contentOffset.x; - }, - }); + const scrollHandler = (event: NativeSyntheticEvent) => { + scrollX.value = event.nativeEvent.contentOffset.x; + }; useEffect(() => { const listener = { @@ -128,7 +126,7 @@ const Onboarding = ({ style={[styles.scrollContainer, transform]} key={'onboarding_content'} > - { return renderSlide({item, index} as ListRenderItemInfo); })} - + ({ ...typography('Heading', 400, 'SemiBold'), }, connect: { - width: 270, + width: 320, letterSpacing: -1, color: theme.centerChannelColor, marginVertical: 12,