From e3fabe12aa590d82297c999625cdd60178d9d1f4 Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Mon, 16 Apr 2018 14:07:15 -0500 Subject: [PATCH 1/2] Add I18nManager and dark-content. The I18nManager.js is a copy/paste from the react-native one, which already had a mock in an `||`, and I just removed the first part of that expression. (Originally tried just leaving it in, but the require('NativeModules') would not just return undefined, but actively throw an error. https://github.com/facebook/react-native/blob/master/Libraries/ReactNative/I18nManager.js#L21 --- src/Libraries/ReactNative/I18nManager.js | 29 ++++++++++++++++++++++++ src/components/StatusBar.js | 2 +- src/react-native.js | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/Libraries/ReactNative/I18nManager.js diff --git a/src/Libraries/ReactNative/I18nManager.js b/src/Libraries/ReactNative/I18nManager.js new file mode 100644 index 0000000..7ec33d2 --- /dev/null +++ b/src/Libraries/ReactNative/I18nManager.js @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule I18nManager + * @flow + * @format + */ +'use strict'; + +type I18nManagerStatus = { + isRTL: boolean, + doLeftAndRightSwapInRTL: boolean, + allowRTL: (allowRTL: boolean) => {}, + forceRTL: (forceRTL: boolean) => {}, + swapLeftAndRightInRTL: (flipStyles: boolean) => {}, +}; + +const I18nManager: I18nManagerStatus = { + isRTL: false, + doLeftAndRightSwapInRTL: true, + allowRTL: () => {}, + forceRTL: () => {}, + swapLeftAndRightInRTL: () => {}, +}; + +module.exports = I18nManager; diff --git a/src/components/StatusBar.js b/src/components/StatusBar.js index 07ca75f..1c6cdd7 100644 --- a/src/components/StatusBar.js +++ b/src/components/StatusBar.js @@ -17,7 +17,7 @@ const StatusBar = createReactClass({ displayName: 'StatusBar', propTypes: { animated: PropTypes.bool, - barStyle: PropTypes.oneOf(['default', 'light-content']), + barStyle: PropTypes.oneOf(['default', 'light-content', 'dark-content']), backgroundColor: ColorPropType, hidden: PropTypes.bool, networkActivityIndicatorVisible: PropTypes.bool, diff --git a/src/react-native.js b/src/react-native.js index c417f52..1095184 100644 --- a/src/react-native.js +++ b/src/react-native.js @@ -72,6 +72,7 @@ const ReactNative = { Dimensions: require('./api/Dimensions'), Easing: require('./api/Animated/Easing'), findNodeHandle: require('./api/findNodeHandle'), + I18nManager: require('./Libraries/ReactNative/I18nManager'), ImagePickerIOS: require('./api/ImagePickerIOS'), IntentAndroid: require('./api/IntentAndroid'), InteractionManager: require('./api/InteractionManager'), From 413595ce25477495c7891288eca5c1c249ec83f5 Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Fri, 8 Jun 2018 17:33:17 -0500 Subject: [PATCH 2/2] Remove providesModule that can lead to Haste dups. --- src/Libraries/ReactNative/I18nManager.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Libraries/ReactNative/I18nManager.js b/src/Libraries/ReactNative/I18nManager.js index 7ec33d2..e006515 100644 --- a/src/Libraries/ReactNative/I18nManager.js +++ b/src/Libraries/ReactNative/I18nManager.js @@ -4,7 +4,6 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @providesModule I18nManager * @flow * @format */