From 418c1c9ae9ad5910be5f00a517d209a0c1ef49b6 Mon Sep 17 00:00:00 2001 From: noumantahir <nouman.hawkdev@gmail.com> Date: Fri, 17 Jun 2022 18:29:02 +0500 Subject: [PATCH] cleaned up index of application container --- .../application/{index.js => index.tsx} | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) rename src/screens/application/{index.js => index.tsx} (79%) diff --git a/src/screens/application/index.js b/src/screens/application/index.tsx similarity index 79% rename from src/screens/application/index.js rename to src/screens/application/index.tsx index 438f04fd9..fb65c5c9a 100644 --- a/src/screens/application/index.js +++ b/src/screens/application/index.tsx @@ -1,13 +1,11 @@ -import React, { Fragment, useEffect, useState } from 'react'; -import { Dimensions } from 'react-native'; +import React, { useEffect } from 'react'; import SplashScreen from 'react-native-splash-screen'; -import { OrientationLocker, PORTRAIT, LANDSCAPE } from 'react-native-orientation-locker'; +import { OrientationLocker, PORTRAIT } from 'react-native-orientation-locker'; import { useDispatch } from 'react-redux'; import ApplicationContainer from './container/applicationContainer'; import WelcomeScreen from './screen/welcomeScreen'; import ApplicationScreen from './screen/applicationScreen'; -import LaunchScreen from '../launch'; import { Modal } from '../../components'; import { PinCode } from '../pinCode'; import ErrorBoundary from './screen/errorBoundary'; @@ -15,16 +13,10 @@ import { setDeviceOrientation } from '../../redux/actions/uiAction'; const Application = () => { const dispatch = useDispatch(); - const [showAnimation, setShowAnimation] = useState(process.env.NODE_ENV !== 'development'); useEffect(() => { SplashScreen.hide(); - if (showAnimation) { - setTimeout(() => { - setShowAnimation(false); - }, 3550); - } - }, [showAnimation]); + }, []); const _handleDeviceOrientationChange = (orientation) => { console.log('device orientation changed at index : ', orientation); @@ -39,7 +31,6 @@ const Application = () => { isPinCodeRequire, isReady, isRenderRequire, - isThemeReady, locale, rcOffer, toastNotification, @@ -47,7 +38,7 @@ const Application = () => { handleWelcomeModalButtonPress, foregroundNotificationData, }) => { - const _isAppReady = !showAnimation && isReady && isRenderRequire && isThemeReady; + const _isAppReady = isReady && isRenderRequire; return ( <ErrorBoundary> @@ -76,7 +67,7 @@ const Application = () => { <PinCode /> </Modal> - {isThemeReady && isRenderRequire && ( + {isRenderRequire && ( <ApplicationScreen isConnected={isConnected} locale={locale} @@ -87,7 +78,6 @@ const Application = () => { foregroundNotificationData={foregroundNotificationData} /> )} - {!_isAppReady && <LaunchScreen />} </ErrorBoundary> ); }}