-
Notifications
You must be signed in to change notification settings - Fork 0
/
WaitingScreen.js
49 lines (44 loc) · 1.37 KB
/
WaitingScreen.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
import React, {Component} from 'react';
import {Modal, StyleSheet, Text, View, Image, ProgressBarAndroid, Platform, ProgressViewIOS} from 'react-native';
export default class WaitingScreen extends Component{
constructor(props){
super(props);
this.state = {
visible: this.props.showLoader
}
}
shouldComponentUpdate(nextProps, nextState){
console.log(nextProps);
if(nextProps.showLoader != this.state.visible){
this.setState({
visible: nextProps.showLoader
})
return true;
}
else{
return false;
}
}
render() {
return (
<Modal visible={this.state.visible}>
<View style={{justifyContent:'center',
alignItems:'center',
height: '100%',
widht: '100%',
backgroundColor:'rgba(0, 0, 0, 0.5)'}}>
<View style={{height:150, width:150, backgroundColor:'#fff', justifyContent:'center', alignItems:'center',borderRadius: 10}}>
<Image source={require('./assets/img/youtube.png')} style={{height:75, width: 75, borderRadius: 20}}/>
{
Platform.OS == 'android' ?
<ProgressBarAndroid styleAttr="Horizontal" /> :
<ProgressViewIOS progressViewStyle={"default"}/>
}
</View>
</View>
</Modal>
);
}
}
const styles = StyleSheet.create({
});