From 19e11232fec6f886d4718805e4edde3b1e0c2708 Mon Sep 17 00:00:00 2001 From: Dave Miller Date: Tue, 13 Oct 2015 11:02:35 -0700 Subject: [PATCH] Move SnapshotView to SnapshotViewIOS and create an unimplemented android version Reviewed By: @andreicoman11 Differential Revision: D2536373 fb-gh-sync-id: 0f671e8198175a15540b74d54e53eee941aa0c1b --- Examples/UIExplorer/UIExplorerList.ios.js | 6 +++--- Libraries/RCTTest/SnapshotViewIOS.android.js | 13 +++++++++++++ .../{SnapshotView.js => SnapshotViewIOS.ios.js} | 8 ++++---- Libraries/react-native/react-native.js | 2 +- 4 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 Libraries/RCTTest/SnapshotViewIOS.android.js rename Libraries/RCTTest/{SnapshotView.js => SnapshotViewIOS.ios.js} (89%) diff --git a/Examples/UIExplorer/UIExplorerList.ios.js b/Examples/UIExplorer/UIExplorerList.ios.js index adc2540d9..7dab3bf07 100644 --- a/Examples/UIExplorer/UIExplorerList.ios.js +++ b/Examples/UIExplorer/UIExplorerList.ios.js @@ -19,7 +19,7 @@ var React = require('react-native'); var { AppRegistry, Settings, - SnapshotView, + SnapshotViewIOS, StyleSheet, } = React; @@ -85,9 +85,9 @@ COMPONENTS.concat(APIS).forEach((Example) => { render: function() { var Renderable = UIExplorerListBase.makeRenderable(Example); return ( - + - + ); }, }); diff --git a/Libraries/RCTTest/SnapshotViewIOS.android.js b/Libraries/RCTTest/SnapshotViewIOS.android.js new file mode 100644 index 000000000..c9127822d --- /dev/null +++ b/Libraries/RCTTest/SnapshotViewIOS.android.js @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule SnapshotViewIOS + */ +'use strict'; + +module.exports = require('UnimplementedView'); diff --git a/Libraries/RCTTest/SnapshotView.js b/Libraries/RCTTest/SnapshotViewIOS.ios.js similarity index 89% rename from Libraries/RCTTest/SnapshotView.js rename to Libraries/RCTTest/SnapshotViewIOS.ios.js index 60733253d..3774dd313 100644 --- a/Libraries/RCTTest/SnapshotView.js +++ b/Libraries/RCTTest/SnapshotViewIOS.ios.js @@ -6,7 +6,7 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule SnapshotView + * @providesModule SnapshotViewIOS * @flow */ 'use strict'; @@ -19,7 +19,7 @@ var View = require('View'); var requireNativeComponent = require('requireNativeComponent'); -var SnapshotView = React.createClass({ +var SnapshotViewIOS = React.createClass({ onDefaultAction: function(event: Object) { TestModule.verifySnapshot(TestModule.markTestPassed); }, @@ -52,7 +52,7 @@ var style = StyleSheet.create({ }); var RCTSnapshot = Platform.OS === 'ios' ? - requireNativeComponent('RCTSnapshot', SnapshotView) : + requireNativeComponent('RCTSnapshot', SnapshotViewIOS) : View; -module.exports = SnapshotView; +module.exports = SnapshotViewIOS; diff --git a/Libraries/react-native/react-native.js b/Libraries/react-native/react-native.js index 51f3d16cf..b461d87f3 100644 --- a/Libraries/react-native/react-native.js +++ b/Libraries/react-native/react-native.js @@ -34,7 +34,7 @@ var ReactNative = Object.assign(Object.create(require('React')), { ScrollView: require('ScrollView'), SegmentedControlIOS: require('SegmentedControlIOS'), SliderIOS: require('SliderIOS'), - SnapshotView: require('SnapshotView'), + SnapshotViewIOS: require('SnapshotViewIOS'), Switch: require('Switch'), SwitchAndroid: require('SwitchAndroid'), SwitchIOS: require('SwitchIOS'),