Michael Hancock 47dfe40b6a Updated example to use ES6 features
Used imports instead of require.
Simplified imports and removed unused component View.
Background is now a const instead of var. <- ES6 prefers this
Removed dangling comma after background ```source={{uri: background, }}```

Generally example is more succinct and easier to understand for users only exposed to the new tools of ES6.
2016-07-01 09:12:28 +01:00

43 lines
1012 B
JavaScript

import React, {Component} from 'react';
import {
AppRegistry,
StyleSheet,
Text,
Image,
} from 'react-native';
import {BlurView, VibrancyView} from 'react-native-blur';
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
backgroundColor: 'transparent',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
color: '#FFFFFF',
},
});
const background = 'http://iphonewallpapers-hd.com/thumbs/firework_iphone_wallpaper_5-t2.jpg';
class Basic extends Component {
render() {
return (
<Image source={{uri: background}} style={styles.container}>
<BlurView blurType="light" style={styles.container}>
<Text style={styles.welcome}>Blur component</Text>
</BlurView>
<VibrancyView blurType="dark" style={styles.container}>
<Text style={styles.welcome}>Vibrancy component</Text>
</VibrancyView>
</Image>
);
}
}
AppRegistry.registerComponent('Basic', () => Basic);