@unpourtous/react-native-image-indicator
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -32,6 +32,14 @@ /** | ||
let source = null | ||
if (props.source) { | ||
if (props.source.uri) { | ||
source = props.source | ||
} else { | ||
source = {uri: props.source} | ||
} | ||
} | ||
this.state = { | ||
loading: false, | ||
progress: 0, | ||
headIcon: {uri: props.source} || null, | ||
headIcon: source, | ||
thresholdReached: !props.threshold | ||
@@ -104,6 +112,14 @@ } | ||
loadImage (url) { | ||
let source = null | ||
if (props.source) { | ||
if (props.source.uri) { | ||
source = props.source | ||
} else { | ||
source = {uri: props.source} | ||
} | ||
} | ||
this.setState({ | ||
loading: false, | ||
progress: 0, | ||
headIcon: {uri: url} || null | ||
headIcon: source | ||
}) | ||
@@ -110,0 +126,0 @@ } |
@@ -33,3 +33,3 @@ /** | ||
style={{alignItems: 'center', justifyContent: 'center', height:300,width:300, backgroundColor: '#fdf9e6'}} | ||
source={'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2527908864,2652178879&fm=23&gp=0.jpg'} | ||
source={'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1496148333&di=fdcac00c65ba9c75ba102380d9c27c87&imgtype=jpg&er=1&src=http%3A%2F%2Fimg2081.poco.cn%2Fmypoco%2Fmyphoto%2F20111110%2F01%2F64030449201111100118289800869654960_068.jpg'} | ||
defaultImage={require('./images/default.jpg')} | ||
@@ -36,0 +36,0 @@ errorImage={require('./images/error.png')} |
@@ -11,3 +11,3 @@ { | ||
"react": "^15.4.2", | ||
"react-native": "0.40.0", | ||
"react-native": "^0.40.0", | ||
"@unpourtous/react-native-image-indicator": "file:../" | ||
@@ -14,0 +14,0 @@ }, |
{ | ||
"name": "@unpourtous/react-native-image-indicator", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "react native component for image with indicator and default image", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
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
339
251124