From a6dd130d5b89650e1ff134595c071f7f9c6be114 Mon Sep 17 00:00:00 2001 From: Ashm Walia <40498934+ashmgarv@users.noreply.github.com> Date: Mon, 7 Dec 2020 15:31:11 -0800 Subject: [TMA-402] New and beautiful splashscreen (#135) * Some changes * Some more changes * Final touch --- src/routes/Routes.tsx | 8 ++++++++ src/routes/onboarding/Onboarding.tsx | 4 +--- src/routes/onboarding/OnboardingStack.tsx | 1 - 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src/routes') diff --git a/src/routes/Routes.tsx b/src/routes/Routes.tsx index e54f038d..cb45ead6 100644 --- a/src/routes/Routes.tsx +++ b/src/routes/Routes.tsx @@ -4,6 +4,7 @@ import Onboarding from './onboarding'; import {useSelector, useDispatch} from 'react-redux'; import {RootState} from '../store/rootReducer'; import {userLogin} from '../utils'; +import SplashScreen from 'react-native-splash-screen'; const Routes: React.FC = () => { const { @@ -18,9 +19,16 @@ const Routes: React.FC = () => { * Suggestions? * NOTE : Not something introduced by this commit but something we already have. */ + + /** + * SplashScreen is the actual react-native's splash screen. + * We can hide / show it depending on our application needs. + */ useEffect(() => { if (!userId) { userLogin(dispatch, {userId: '', username: ''}); + } else { + SplashScreen.hide(); } }, [userId, userLogin]); diff --git a/src/routes/onboarding/Onboarding.tsx b/src/routes/onboarding/Onboarding.tsx index 138fb3ed..4ebc281c 100644 --- a/src/routes/onboarding/Onboarding.tsx +++ b/src/routes/onboarding/Onboarding.tsx @@ -9,7 +9,6 @@ import { Verification, ProfileOnboarding, Checkpoint, - Splash, SocialMedia, } from '../../screens'; import {StackCardInterpolationProps} from '@react-navigation/stack'; @@ -23,9 +22,8 @@ const forFade = ({current}: StackCardInterpolationProps) => ({ const Onboarding: React.FC = () => { return ( -