react-cimpress-fulfiller-logo
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -78,12 +78,12 @@ import React, { Component } from 'react'; | ||
render() { | ||
let childContent = null; | ||
let childContent = this.props.placeholder; | ||
if (this.state.imageBlob) { | ||
let objectURL = URL.createObjectURL(this.state.imageBlob); | ||
childContent = React.createElement('img', { style: { maxWidth: "inherit", maxHeight: "inherit" }, src: objectURL }); | ||
} else if (this.state.imageIsLoading && this.props.imageLoading) { | ||
childContent = this.props.imageLoading; | ||
} else if (this.state.imageIsForbidden && this.props.noAccess) { | ||
childContent = this.props.noAccess; | ||
} else if (this.state.imageIsLoading) { | ||
childContent = this.props.imageLoading || this.props.placeholder; | ||
} else if (this.state.imageIsForbidden) { | ||
childContent = this.props.noAccess || this.props.noImage || this.props.placeholder; | ||
} else if (this.props.noImage) { | ||
childContent = this.props.noImage; | ||
childContent = this.props.noImage || this.props.placeholder; | ||
} | ||
@@ -93,2 +93,6 @@ | ||
if (!childContent) { | ||
childContent = React.createElement('span', null); | ||
} | ||
if (this.props.className) { | ||
@@ -121,3 +125,4 @@ content = React.createElement( | ||
imageLoading: PropTypes.object, | ||
noAccess: PropTypes.object | ||
noAccess: PropTypes.object, | ||
placeholder: PropTypes.object | ||
}; |
{ | ||
"name": "react-cimpress-fulfiller-logo", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "Fetches fulfiller logo from Fulfiller Identity Service.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -41,1 +41,19 @@ # react-cimpress-fulfiller-logo | ||
<FulfillerLogo noImage={"No Image"} fulfillerId="fulfillerId" accessToken={localStorage.getItem('accessToken')}/> | ||
### Other overrides | ||
Fulfiller Logo defines following props, that take content | ||
noImage: PropTypes.object, | ||
imageLoading: PropTypes.object, | ||
noAccess: PropTypes.object, | ||
placeholder: PropTypes.object | ||
`placeholder` is the image that is displayed from the mounting moment till the loading starts (since the component automatically loads the image when it comes into view this should very short period of time | ||
`imageLoading` is the content that is displayed while loading, falls back to `placeholder` | ||
`noAccess` is shown when the user doesn't have access to see fulfiller logo, falls back to `noImage` | ||
`noImage` what gets displayed if the image is not available (for whatever reason) |
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
6539
114
59