UNPKG

1.03 kBJavaScriptView Raw
1'use strict';
2
3import React, {
4 Component,
5 PropTypes,
6} from 'react';
7
8import {
9 View,
10 requireNativeComponent,
11 } from 'react-native';
12
13import deprecatedPropType from 'react-native/Libraries/Utilities/deprecatedPropType';
14
15export default class BlurView extends Component {
16 static propTypes = {
17 tintEffect: deprecatedPropType(
18 PropTypes.string,
19 'Use the `tint` prop instead.'
20 ),
21 tint: PropTypes.oneOf(['light', 'default', 'dark']).isRequired,
22 intensity: PropTypes.number.isRequired,
23 ...View.propTypes,
24 };
25
26 static defaultProps = {
27 tint: 'default',
28 intensity: 50,
29 }
30
31 render() {
32 let { style, ...nativeProps } = this.props;
33
34 if (nativeProps.tintEffect) {
35 nativeProps.tint = nativeProps.tintEffect;
36 delete nativeProps.tintEffect;
37 }
38
39 return (
40 <NativeBlurView
41 {...nativeProps}
42 style={[this.props.style, { backgroundColor: 'transparent' }]}
43 />
44 );
45 }
46}
47
48const NativeBlurView = requireNativeComponent('ExponentBlurView', null);