Add 'unimplemented view' stubs

This commit is contained in:
Nicolas Gallagher
2017-06-18 15:27:24 -07:00
parent d1d570268a
commit 44b185ed4c
11 changed files with 89 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
import UnimplementedView from '../UnimplementedView';
export default UnimplementedView;

View File

@@ -0,0 +1,2 @@
import UnimplementedView from '../UnimplementedView';
export default UnimplementedView;

View File

@@ -0,0 +1,2 @@
import UnimplementedView from '../UnimplementedView';
export default UnimplementedView;

View File

@@ -0,0 +1,2 @@
import UnimplementedView from '../UnimplementedView';
export default UnimplementedView;

View File

@@ -0,0 +1,2 @@
import UnimplementedView from '../UnimplementedView';
export default UnimplementedView;

View File

@@ -0,0 +1,2 @@
import UnimplementedView from '../UnimplementedView';
export default UnimplementedView;

View File

@@ -0,0 +1,2 @@
import UnimplementedView from '../UnimplementedView';
export default UnimplementedView;

View File

@@ -0,0 +1,49 @@
/**
* 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 UnimplementedView
* @flow
*/
import View from '../View';
import { any, object } from 'prop-types';
import React, { Component } from 'react';
/**
* Common implementation for a simple stubbed view.
*/
class UnimplementedView extends Component {
static propTypes = {
children: any,
style: object
};
setNativeProps() {
// Do nothing.
// This method is required in order to use this view as a Touchable* child.
// See ensureComponentIsNative.js for more info
}
render() {
return (
<View style={[unimplementedViewStyles, this.props.style]}>
{this.props.children}
</View>
);
}
}
const unimplementedViewStyles = process.env.NODE_ENV !== 'production'
? {
alignSelf: 'flex-start',
borderColor: 'red',
borderWidth: 1
}
: {};
export default UnimplementedView;

View File

@@ -0,0 +1,2 @@
import UnimplementedView from '../UnimplementedView';
export default UnimplementedView;

View File

@@ -32,19 +32,27 @@ import {
// components
ActivityIndicator,
Button,
FlatList,
Image,
ListView,
Modal,
Picker,
ProgressBar,
RefreshControl,
ScrollView,
SectionList,
Slider,
StatusBar,
Switch,
Text,
TextInput,
Touchable,
TouchableHighlight,
TouchableNativeFeedback,
TouchableOpacity,
TouchableWithoutFeedback,
View,
VirtualizedList,
// propTypes
ColorPropType,
@@ -89,19 +97,27 @@ const ReactNative = {
// components
ActivityIndicator,
Button,
FlatList,
Image,
ListView,
Modal,
Picker,
ProgressBar,
RefreshControl,
ScrollView,
SectionList,
Slider,
StatusBar,
Switch,
Text,
TextInput,
Touchable,
TouchableHighlight,
TouchableNativeFeedback,
TouchableOpacity,
TouchableWithoutFeedback,
View,
VirtualizedList,
// propTypes
ColorPropType,

View File

@@ -27,21 +27,29 @@ export { default as Vibration } from './apis/Vibration';
// components
export { default as ActivityIndicator } from './components/ActivityIndicator';
export { default as Button } from './components/Button';
export { default as FlatList } from './components/FlatList';
export { default as Image } from './components/Image';
export { default as ListView } from './components/ListView';
export { default as Modal } from './components/Modal';
export { default as Picker } from './components/Picker';
export { default as ProgressBar } from './components/ProgressBar';
export { default as RefreshControl } from './components/RefreshControl';
export { default as ScrollView } from './components/ScrollView';
export { default as SectionList } from './components/SectionList';
export { default as Slider } from './components/Slider';
export { default as StatusBar } from './components/StatusBar';
export { default as Switch } from './components/Switch';
export { default as Text } from './components/Text';
export { default as TextInput } from './components/TextInput';
export { default as Touchable } from './components/Touchable/Touchable';
export { default as TouchableHighlight } from './components/Touchable/TouchableHighlight';
export { default as TouchableNativeFeedback } from './components/Touchable/TouchableNativeFeedback';
export { default as TouchableOpacity } from './components/Touchable/TouchableOpacity';
export {
default as TouchableWithoutFeedback
} from './components/Touchable/TouchableWithoutFeedback';
export { default as View } from './components/View';
export { default as VirtualizedList } from './components/VirtualizedList';
// propTypes
export { default as ColorPropType } from './propTypes/ColorPropType';