-
Notifications
You must be signed in to change notification settings - Fork 24
/
index.ios.js
49 lines (39 loc) · 1.04 KB
/
index.ios.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
* ReactNativeEffectsView
* http://github.com/voronianski/react-native-effects-view
*/
'use strict';
import React from 'react';
import PropTypes from 'prop-types';
import {
View,
StyleSheet,
requireNativeComponent,
} from 'react-native';
const EffectsViewComponent = (props) => {
const { children, vibrantContent } = props;
const vibrantNode = vibrantContent ? vibrantContent : <View />;
const {style, ...nativeProps} = props;
return (
<EffectsView {...nativeProps} style={styles.base, style}>
{vibrantNode}
{children}
</EffectsView>
);
};
EffectsViewComponent.defaultProps = {
vibrant: true,
blurStyle: true,
};
EffectsViewComponent.propTypes = {
vibrant: PropTypes.bool,
blurStyle: PropTypes.string,
vibrantContent: PropTypes.node
};
const EffectsView = requireNativeComponent('DVEffectsView', EffectsViewComponent);
const styles = StyleSheet.create({
base: {
backgroundColor: 'transparent'
}
});
module.exports = EffectsViewComponent;