rn-progress-loader
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "rn-progress-loader", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "The React Native Native iOS and Android progress indicator (spinner) which acts like an overlay. For those who have issues in iPhoneX while using both Modal and ActivityIndicator, I've made it optional", | ||
@@ -5,0 +5,0 @@ "main": "ProgressLoader.js", |
@@ -19,25 +19,34 @@ /** | ||
constructor(props) { | ||
super(props); | ||
this.props = props; | ||
this.state = { | ||
visible: this.props.visible, | ||
isModal:this.props.isModal, | ||
barHeight:this.props.barHeight, | ||
constructor(props) { | ||
super(props); | ||
this.props = props; | ||
this.state = { | ||
visible: this.props.visible, | ||
isModal:this.props.isModal, | ||
color:this.props.color, | ||
barHeight:this.props.barHeight, | ||
isHUD:this.props.isHUD, | ||
hudColor:this.props.hudColor | ||
} | ||
} | ||
} | ||
} | ||
static propTypes = { | ||
visible: PropTypes.bool.isRequired, | ||
isModal: PropTypes.bool.isRequired, | ||
barHeight: PropTypes.number | ||
static propTypes = { | ||
visible: PropTypes.bool.isRequired, | ||
isModal: PropTypes.bool.isRequired, | ||
barHeight: PropTypes.number, | ||
color:PropTypes.string, | ||
hudColor:PropTypes.string, | ||
isHUD:PropTypes.bool | ||
}; | ||
}; | ||
static defaultProps = { | ||
visible: false, | ||
isModal:true, | ||
barHeight:64 | ||
}; | ||
static defaultProps = { | ||
visible: false, | ||
isModal:true, | ||
barHeight:64, | ||
color:"#FFFFFF", | ||
hudColor:'#FFFFFF', | ||
isHUD:false | ||
}; | ||
@@ -54,8 +63,4 @@ | ||
<View style={styles.modalBackground}> | ||
<View style={styles.activityIndicatorWrapper}> | ||
<ActivityIndicator | ||
size="small" | ||
color={"#9b9a99"} | ||
style={{zIndex:100}} | ||
animating={this.props.visible} /> | ||
<View style={[styles.activityIndicatorWrapper,{backgroundColor:(this.props.isHUD?(this.props.hudColor):("transparent"))}]}> | ||
{this.renderActivityIndicator()} | ||
</View> | ||
@@ -67,2 +72,21 @@ </View> | ||
renderActivityIndicator(){ | ||
const loaderColor = this.props.color; | ||
return( | ||
this.props.isModal?( | ||
<ActivityIndicator | ||
size="small" | ||
color={loaderColor} | ||
style={{zIndex:100}} | ||
animating={this.props.visible} /> | ||
):( | ||
<ActivityIndicator | ||
size="small" | ||
color={loaderColor} | ||
style={{zIndex:100,marginBottom:this.props.barHeight}} | ||
animating={this.props.visible} /> | ||
) | ||
) | ||
} | ||
renderWithView(){ | ||
@@ -73,6 +97,3 @@ return( | ||
> | ||
<ActivityIndicator | ||
size="small" | ||
style={{zIndex:100,marginBottom:this.props.barHeight}} | ||
animating={this.props.visible} /> | ||
{this.renderActivityIndicator()} | ||
</View> | ||
@@ -79,0 +100,0 @@ ) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8018
139