From 61c0b3bd61c6d0f7d3a2907a3d015bd5d18f8c5c Mon Sep 17 00:00:00 2001 From: "REDMOND\\acoates" Date: Mon, 6 Jan 2020 14:13:50 -0800 Subject: [PATCH 1/2] Remove some usages of win32 that are no longer needed. --- Libraries/Components/TextInput/TextInputState.js | 12 ------------ Libraries/StyleSheet/StyleSheet.js | 6 +----- Libraries/YellowBox/UI/YellowBoxList.js | 12 ++++-------- metro.config.js | 2 +- 4 files changed, 6 insertions(+), 26 deletions(-) diff --git a/Libraries/Components/TextInput/TextInputState.js b/Libraries/Components/TextInput/TextInputState.js index 7d0fe39d466b8f..61df6e0f985275 100644 --- a/Libraries/Components/TextInput/TextInputState.js +++ b/Libraries/Components/TextInput/TextInputState.js @@ -49,12 +49,6 @@ function focusTextInput(textFieldID: ?number) { .focusTextInput, null, ); - } else if (Platform.OS === 'win32') { - UIManager.dispatchViewManagerCommand( - textFieldID, - UIManager.RCTView.Commands.focus, - null, - ); } } } @@ -79,12 +73,6 @@ function blurTextInput(textFieldID: ?number) { .blurTextInput, null, ); - } else if (Platform.OS === 'win32') { - UIManager.dispatchViewManagerCommand( - textFieldID, - UIManager.RCTView.Commands.blur, - null, - ); } } } diff --git a/Libraries/StyleSheet/StyleSheet.js b/Libraries/StyleSheet/StyleSheet.js index 18c6ced65bdc92..2692dd5892e4b7 100644 --- a/Libraries/StyleSheet/StyleSheet.js +++ b/Libraries/StyleSheet/StyleSheet.js @@ -12,7 +12,6 @@ const PixelRatio = require('../Utilities/PixelRatio'); const ReactNativeStyleAttributes = require('../Components/View/ReactNativeStyleAttributes'); const StyleSheetValidation = require('./StyleSheetValidation'); -const Platform = require('../Utilities/Platform'); // TODO(macOS ISS#2323203) const flatten = require('./flattenStyle'); @@ -152,10 +151,7 @@ export type ImageStyle = ____ImageStyle_Internal; */ export type DangerouslyImpreciseStyle = ____DangerouslyImpreciseStyle_Internal; -let hairlineWidth = - Platform.OS === 'win32' || Platform.OS === 'windesktop' - ? 0.5 - : PixelRatio.roundToNearestPixel(0.4); // TODO(windows ISS) +let hairlineWidth = PixelRatio.roundToNearestPixel(0.4); if (hairlineWidth === 0) { hairlineWidth = 1 / PixelRatio.get(); } diff --git a/Libraries/YellowBox/UI/YellowBoxList.js b/Libraries/YellowBox/UI/YellowBoxList.js index 220ca53faa8ee9..4d8921c36e9f17 100644 --- a/Libraries/YellowBox/UI/YellowBoxList.js +++ b/Libraries/YellowBox/UI/YellowBoxList.js @@ -20,7 +20,6 @@ const YellowBoxButton = require('./YellowBoxButton'); const YellowBoxInspector = require('./YellowBoxInspector'); const YellowBoxListRow = require('./YellowBoxListRow'); const YellowBoxStyle = require('./YellowBoxStyle'); -const Platform = require('../../Utilities/Platform'); // TODO(windows ISS) import type {Category} from '../Data/YellowBoxCategory'; import type {Registry} from '../Data/YellowBoxRegistry'; @@ -36,13 +35,10 @@ type State = {| |}; const VIEWPORT_RATIO = 0.5; -const MAX_ITEMS = - Platform.OS === 'win32' || Platform.OS === 'windesktop' - ? 3 - : Math.floor( +const MAX_ITEMS = Math.floor( (Dimensions.get('window').height * VIEWPORT_RATIO) / (YellowBoxListRow.GUTTER + YellowBoxListRow.HEIGHT), - ); // TODO(windows ISS) + ); class YellowBoxList extends React.Component { state = { @@ -73,7 +69,7 @@ class YellowBoxList extends React.Component { } const listStyle = { - width: Platform.OS === 'win32' ? '85%' : undefined, + width: undefined, height: // Additional `0.5` so the (N + 1)th row can peek into view. Math.min(items.length, MAX_ITEMS + 0.5) * @@ -130,7 +126,7 @@ const styles = StyleSheet.create({ width: '100%', }, dismissAll: { - bottom: Platform.OS === 'win32' ? 0 : '100%', + bottom: '100%', flexDirection: 'row', justifyContent: 'flex-end', paddingBottom: 4, diff --git a/metro.config.js b/metro.config.js index 894deae5c1fb4d..4950b56ad33b25 100644 --- a/metro.config.js +++ b/metro.config.js @@ -56,7 +56,7 @@ if ( }, resolver: { hasteImplModulePath: require.resolve('./jest/hasteImpl'), - platforms: ['win32', 'ios', 'macos', 'android'], + platforms: ['ios', 'macos', 'android'], }, transformer: { assetRegistryPath: require.resolve('./Libraries/Image/AssetRegistry'), From a356da9954775772177eabc8f4007ab57adffe12 Mon Sep 17 00:00:00 2001 From: "REDMOND\\acoates" Date: Mon, 6 Jan 2020 14:32:38 -0800 Subject: [PATCH 2/2] lint fix --- Libraries/YellowBox/UI/YellowBoxList.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/YellowBox/UI/YellowBoxList.js b/Libraries/YellowBox/UI/YellowBoxList.js index 4d8921c36e9f17..d5caa06ee2cbf9 100644 --- a/Libraries/YellowBox/UI/YellowBoxList.js +++ b/Libraries/YellowBox/UI/YellowBoxList.js @@ -36,9 +36,9 @@ type State = {| const VIEWPORT_RATIO = 0.5; const MAX_ITEMS = Math.floor( - (Dimensions.get('window').height * VIEWPORT_RATIO) / - (YellowBoxListRow.GUTTER + YellowBoxListRow.HEIGHT), - ); + (Dimensions.get('window').height * VIEWPORT_RATIO) / + (YellowBoxListRow.GUTTER + YellowBoxListRow.HEIGHT), +); class YellowBoxList extends React.Component { state = {