diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 8e69ec44c..fb9119b7d 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -441,8 +441,6 @@ PODS: - React-cxxreact (= 0.62.3) - React-jsi (= 0.62.3) - ReactCommon/callinvoker (= 0.62.3) - - ReactNativeDarkMode (0.2.2): - - React - rn-fetch-blob (0.12.0): - React-Core - RNCAsyncStorage (1.12.1): @@ -570,7 +568,6 @@ DEPENDENCIES: - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) - ReactCommon/callinvoker (from `../node_modules/react-native/ReactCommon`) - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) - - ReactNativeDarkMode (from `../node_modules/react-native-dark-mode`) - rn-fetch-blob (from `../node_modules/rn-fetch-blob`) - "RNCAsyncStorage (from `../node_modules/@react-native-community/async-storage`)" - "RNCPushNotificationIOS (from `../node_modules/@react-native-community/push-notification-ios`)" @@ -713,8 +710,6 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/Libraries/Vibration" ReactCommon: :path: "../node_modules/react-native/ReactCommon" - ReactNativeDarkMode: - :path: "../node_modules/react-native-dark-mode" rn-fetch-blob: :path: "../node_modules/rn-fetch-blob" RNCAsyncStorage: @@ -823,7 +818,6 @@ SPEC CHECKSUMS: React-RCTText: fc8aaead300090f23dd0974545d75e3c43883922 React-RCTVibration: 36a70f1015574284fa6770993c1e83a1f85dbabc ReactCommon: 3ea86417fa6e432b500579df40b057df54cfb4d4 - ReactNativeDarkMode: 0178ffca3b10f6a7c9f49d6f9810232b328fa949 rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba RNCAsyncStorage: b03032fdbdb725bea0bd9e5ec5a7272865ae7398 RNCPushNotificationIOS: 61a7c72bd1ebad3568025957d001e0f0e7b32191 diff --git a/package.json b/package.json index 13099c859..5828dfa27 100644 --- a/package.json +++ b/package.json @@ -70,8 +70,8 @@ "react-native-animatable": "^1.3.3", "react-native-autoheight-webview": "^1.5.8", "react-native-config": "luggit/react-native-config#master", - "react-native-dark-mode": "^0.2.2", "react-native-date-picker": "^3.2.7", + "react-native-dynamic": "^1.0.0", "react-native-extended-stylesheet": "^0.10.0", "react-native-fast-image": "^8.3.2", "react-native-gesture-handler": "^1.9.0", diff --git a/src/components/actionModal/container/actionModalContainer.tsx b/src/components/actionModal/container/actionModalContainer.tsx index c85f822b9..f030b39dd 100644 --- a/src/components/actionModal/container/actionModalContainer.tsx +++ b/src/components/actionModal/container/actionModalContainer.tsx @@ -2,9 +2,8 @@ import React, { useEffect, useRef, useState } from 'react'; import {AlertButton, ButtonProps } from 'react-native'; import { Source } from 'react-native-fast-image'; import { useSelector, useDispatch } from 'react-redux'; -import { ActionModalView } from '..'; import { hideActionModal } from '../../../redux/actions/uiAction'; -import { ActionModalRef } from '../view/actionModalView'; +import ActionModalView, { ActionModalRef } from '../view/actionModalView'; export interface ActionModalData { title:string, diff --git a/src/screens/application/container/applicationContainer.js b/src/screens/application/container/applicationContainer.js index 0f7678a17..64a5cd84a 100644 --- a/src/screens/application/container/applicationContainer.js +++ b/src/screens/application/container/applicationContainer.js @@ -10,10 +10,7 @@ import { NavigationActions } from 'react-navigation'; import { bindActionCreators } from 'redux'; import EStyleSheet from 'react-native-extended-stylesheet'; import { isEmpty, some } from 'lodash'; -import { - initialMode as nativeThemeInitialMode, - eventEmitter as nativeThemeEventEmitter, -} from 'react-native-dark-mode'; +import { useDarkMode } from 'react-native-dynamic'; import messaging from '@react-native-firebase/messaging'; import PushNotification from 'react-native-push-notification'; import VersionNumber from 'react-native-version-number'; @@ -149,13 +146,13 @@ class ApplicationContainer extends Component { AppState.addEventListener('change', this._handleAppStateChange); setPreviousAppState(); - if (nativeThemeEventEmitter) { + /*if (nativeThemeEventEmitter) { nativeThemeEventEmitter.on('currentModeChanged', (newMode) => { const { dispatch } = this.props; dispatch(isDarkTheme(newMode === 'dark')); }); - } + }*/ this._createPushListener(); if (!isIos) BackHandler.addEventListener('hardwareBackPress', this._onBackPress); @@ -724,11 +721,8 @@ class ApplicationContainer extends Component { const settings = await getSettings(); if (settings) { - dispatch( - isDarkTheme( - settings.isDarkTheme === null ? nativeThemeInitialMode === 'dark' : settings.isDarkTheme, - ), - ); + const isDarkMode = false; //useDarkMode(); + dispatch(isDarkTheme(settings.isDarkTheme === null ? settings.isDarkTheme : isDarkMode)); this.setState({ isThemeReady: true, }); diff --git a/src/screens/launch/screen/launchScreen.js b/src/screens/launch/screen/launchScreen.js index 118e36832..f56f344ea 100644 --- a/src/screens/launch/screen/launchScreen.js +++ b/src/screens/launch/screen/launchScreen.js @@ -1,11 +1,11 @@ import React from 'react'; import { View } from 'react-native'; import LottieView from 'lottie-react-native'; -import { initialMode as nativeThemeInitialMode } from 'react-native-dark-mode'; +import { useDarkMode } from 'react-native-dynamic'; import styles from './launchStyles'; const LaunchScreen = () => ( - + =0.62.0": + version "0.64.12" + resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.64.12.tgz#1c6a3226c26d7a5949cdf8878e6cfe95fe0951d6" + integrity sha512-sw6WGSaL219zqrgdb4kQUtFB9iGXC/LmecLZ+UUWEgwYvD0YH81FqWYmONa2HuTkOFAsxu2bK4DspkWRUHIABQ== dependencies: "@types/react" "*" @@ -3793,7 +3788,7 @@ events@^1.1.0: resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" integrity sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ= -events@^3.0.0, events@^3.2.0: +events@^3.2.0: version "3.3.0" resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== @@ -7669,22 +7664,20 @@ react-native-config@luggit/react-native-config#master: version "1.4.2" resolved "https://codeload.github.com/luggit/react-native-config/tar.gz/81f599f5f912b84c41c9ef2901faf54995638c4e" -react-native-dark-mode@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/react-native-dark-mode/-/react-native-dark-mode-0.2.2.tgz#4faa335e36330bfca832ba8b3d2bd84c7b880381" - integrity sha512-2vhWOOimU7DRKYjCU/pdv0+JpnGKURq5+c7bre093Jtzk57HtlJfd+ViibbC9Y8zh0viIOyKtfL5mYhVhZ6Crw== - dependencies: - "@types/events" "*" - "@types/react" "*" - "@types/react-native" "*" - events "^3.0.0" - toolkit.ts "^0.0.2" - react-native-date-picker@^3.2.7: version "3.2.10" resolved "https://registry.yarnpkg.com/react-native-date-picker/-/react-native-date-picker-3.2.10.tgz#5e690db8e628255d8390e33b1e6f8fa9477f6fb9" integrity sha512-/fA+htnZcr3rBw3eaOR/DvMwGLDTg59MCiiluin5YcHBxNZQYs/uYp/l6Hf719qZXndPGcixS46YIgso4Jf4gg== +react-native-dynamic@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/react-native-dynamic/-/react-native-dynamic-1.0.0.tgz#d971618fd278cf66acb0add46536aa7a68fd8d4f" + integrity sha512-CMP97GREQ74tpwhKFdUiMpvybzO+dp13Y70rCyu6qzTouOde9vlpDHlxa++o0EA6kXucEW28x3GN0rvZ/1bjrA== + dependencies: + "@types/react" "*" + "@types/react-native" ">=0.62.0" + toolkit.ts "^0.0.2" + react-native-extended-stylesheet@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/react-native-extended-stylesheet/-/react-native-extended-stylesheet-0.10.0.tgz#bc77caf7494dcc67f681128dd8cb5e07dacef9dd"