Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit 51020a1

Browse files
committed
Merge pull request #56 from omeid/master
Components:TouchableOpacity: Add basic mock.
2 parents 2199f23 + 9947c88 commit 51020a1

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/components/TouchableOpacity.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* https://github.com/facebook/react-native/blob/master/Libraries/Components/Touchable/TouchableOpacity.js
3+
*/
4+
import React from 'react';
5+
6+
import TouchableWithoutFeedback from './TouchableWithoutFeedback';
7+
8+
const TouchableOpacity = React.createClass({
9+
propTypes: {
10+
...TouchableWithoutFeedback.propTypes,
11+
12+
/**
13+
* Determines what the opacity of the wrapped view should be when touch is
14+
* active. Defaults to 0.2.
15+
*/
16+
activeOpacity: React.PropTypes.number,
17+
},
18+
19+
render() {
20+
return null;
21+
},
22+
});
23+
24+
module.exports = TouchableOpacity;

src/react-native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const ReactNative = {
4646
Touchable: createMockComponent('Touchable'),
4747
TouchableHighlight: createMockComponent('TouchableHighlight'),
4848
TouchableNativeFeedback: createMockComponent('TouchableNativeFeedback'),
49-
TouchableOpacity: createMockComponent('TouchableOpacity'),
49+
TouchableOpacity: require('./components/TouchableOpacity'),
5050
TouchableWithoutFeedback: require('./components/TouchableWithoutFeedback'),
5151
View: require('./components/View'),
5252
ViewPagerAndroid: createMockComponent('ViewPagerAndroid'),

0 commit comments

Comments
 (0)