Fix the example project (#361)

This commit is contained in:
Alexey Kureev 2020-03-10 23:19:19 +00:00 committed by GitHub
parent 47a199ef98
commit e2075520c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,10 +46,10 @@ export default class Basic extends Component {
renderBlurs() { renderBlurs() {
const tintColor = this.state.blurBlurType === 'xlight' ? 'black' : 'white'; const tintColor = this.state.blurBlurType === 'xlight' ? 'black' : 'white';
const platform = Platform.OS === 'ios' ? 'iOS' : 'Android';
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View style={styles.blurContainer}> <View style={styles.blurContainer}>
{/* {/*
BlurView is supported on both iOS and Android. BlurView is supported on both iOS and Android.
@ -62,27 +62,25 @@ export default class Basic extends Component {
blurAmount={100} blurAmount={100}
style={[styles.blurView]}> style={[styles.blurView]}>
<Text style={[styles.text, { color: tintColor }]}> <Text style={[styles.text, { color: tintColor }]}>
Blur component (iOS) Blur component ({platform})
</Text> </Text>
{{ {Platform.OS === 'ios' &&
Platform.OS === "ios" &&
<SegmentedControlIOS <SegmentedControlIOS
values={['xlight', 'light', 'dark', 'regular', 'prominent']} values={['xlight', 'light', 'dark', 'regular', 'prominent']}
selectedIndex={this.state.blurActiveSegment} selectedIndex={this.state.blurActiveSegment}
onChange={(event) => {this._onBlurChange(event);}} onChange={(event) => {this._onBlurChange(event);}}
onValueChange={(value) => {this._onBlurValueChange(value);}} onValueChange={(value) => {this._onBlurValueChange(value);}}
tintColor={tintColor} tintColor={tintColor}
/> />}
}}
</BlurView> </BlurView>
</View> </View>
{/* {
/*
VibrancyView is only supported on iOS, and must contain child views, VibrancyView is only supported on iOS, and must contain child views,
otherwise the vibrancy effect doesn't work. otherwise the vibrancy effect doesn't work.
*/} */
{{ Platform.OS === 'ios' &&
Platform.OS === "ios" &&
<VibrancyView <VibrancyView
blurType={this.state.vibrancyBlurType} blurType={this.state.vibrancyBlurType}
blurAmount={10} blurAmount={10}
@ -100,7 +98,7 @@ export default class Basic extends Component {
tintColor="white" tintColor="white"
/> />
</VibrancyView> </VibrancyView>
}} }
</View> </View>
); );
} }