From 7b87d111eb06ea2a713d951c316ef6fb99c3cad1 Mon Sep 17 00:00:00 2001 From: noumantahir Date: Fri, 17 Jun 2022 18:29:25 +0500 Subject: [PATCH] cleaned up application screen class --- .../application/screen/applicationScreen.js | 45 ++----------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/src/screens/application/screen/applicationScreen.js b/src/screens/application/screen/applicationScreen.js index d60672014..3d5fdd9fb 100644 --- a/src/screens/application/screen/applicationScreen.js +++ b/src/screens/application/screen/applicationScreen.js @@ -1,10 +1,9 @@ import React, { Component, Fragment } from 'react'; -import { StatusBar, Platform, View, Alert, Text, Modal, TouchableHighlight } from 'react-native'; +import { StatusBar, Platform, View, Alert } from 'react-native'; import EStyleSheet from 'react-native-extended-stylesheet'; import { connect } from 'react-redux'; import { createAppContainer } from 'react-navigation'; import { injectIntl } from 'react-intl'; -import VersionNumber from 'react-native-version-number'; import AppNavitation from '../../../navigation/routes'; import { setTopLevelNavigator, navigate } from '../../../navigation/service'; @@ -14,7 +13,6 @@ import { toastNotification as toastNotificationAction, setRcOffer, } from '../../../redux/actions/uiAction'; -import { getVersionForWelcomeModal } from '../../../realm/realm'; import ROUTES from '../../../constants/routeNames'; @@ -32,7 +30,6 @@ import { // Themes (Styles) import darkTheme from '../../../themes/darkTheme'; import lightTheme from '../../../themes/lightTheme'; -import parseVersionNumber from '../../../utils/parseVersionNumber'; const Navigation = createAppContainer(AppNavitation); @@ -41,20 +38,9 @@ class ApplicationScreen extends Component { super(props); this.state = { isShowToastNotification: false, - showWelcomeModal: false, }; } - componentDidMount() { - const { appVersion } = VersionNumber; - - getVersionForWelcomeModal().then((version) => { - if (version < parseVersionNumber(appVersion)) { - this.setState({ showWelcomeModal: true }); - } - }); - } - componentDidUpdate(prevProps) { const { rcOffer, dispatch, intl } = this.props; const { rcOffer: rcOfferPrev } = prevProps; @@ -117,7 +103,7 @@ class ApplicationScreen extends Component { foregroundNotificationData, navigation, } = this.props; - const { isShowToastNotification, showWelcomeModal } = this.state; + const { isShowToastNotification } = this.state; const barStyle = isDarkTheme ? 'light-content' : 'dark-content'; const barColor = isDarkTheme ? '#1e2835' : '#fff'; @@ -128,6 +114,7 @@ class ApplicationScreen extends Component { ) : ( )} + {!isConnected && } - { - Alert.alert('Modal has been closed.'); - }} - > - - Hello World! - { - this.setState({ showWelcomeModal: !showWelcomeModal }); - }} - > - Hide Modal - - - {isShowToastNotification && (